mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-05 16:47:14 -04:00
~/.config is created if it does not already exist
This commit is contained in:
+3
-5
@@ -4,19 +4,17 @@
|
|||||||
|
|
||||||
# external modules
|
# external modules
|
||||||
|
|
||||||
from os import system, remove, mkdir, walk
|
from os import mkdir, path, remove, system, walk
|
||||||
from os.path import getmtime, join, expanduser
|
from os.path import getmtime, join, expanduser
|
||||||
from sys import exit as s_exit
|
from sys import exit as s_exit
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
# utility functions
|
# utility functions
|
||||||
|
|
||||||
def get_titles_mods(_directory, _destination, _user_data):
|
def get_titles_mods(_directory, _destination, _user_data):
|
||||||
_title_list, _mod_list = [], []
|
_title_list, _mod_list = [], []
|
||||||
try: # create config directory
|
Path(path.expanduser('~/.config/sshync')).mkdir(0o700, parents=True, exist_ok=True) # create config directory
|
||||||
mkdir(expanduser('~/.config/sshync'), 0o700)
|
|
||||||
except FileExistsError:
|
|
||||||
pass
|
|
||||||
# local fetching
|
# local fetching
|
||||||
if _destination == 'l':
|
if _destination == 'l':
|
||||||
remove(expanduser('~/.config/sshync/database')) # assumed to exist because remote runs first
|
remove(expanduser('~/.config/sshync/database')) # assumed to exist because remote runs first
|
||||||
|
|||||||
@@ -52,10 +52,7 @@ def tweak(): # runs configuration wizard
|
|||||||
mkdir(path.expanduser('~/.password-pasture'), 0o700)
|
mkdir(path.expanduser('~/.password-pasture'), 0o700)
|
||||||
except FileExistsError:
|
except FileExistsError:
|
||||||
pass
|
pass
|
||||||
try:
|
Path(path.expanduser('~/.config/sshyp')).mkdir(0o700, parents=True, exist_ok=True)
|
||||||
mkdir(path.expanduser('~/.config/sshyp'), 0o700)
|
|
||||||
except FileExistsError:
|
|
||||||
pass
|
|
||||||
if not Path(f"{path.expanduser('~/.config/sshyp/tmp')}").exists():
|
if not Path(f"{path.expanduser('~/.config/sshyp/tmp')}").exists():
|
||||||
if Path("/data/data/com.termux").exists():
|
if Path("/data/data/com.termux").exists():
|
||||||
system(f"ln -s '/data/data/com.termux/files/usr/tmp' {path.expanduser('~/.config/sshyp/tmp')}")
|
system(f"ln -s '/data/data/com.termux/files/usr/tmp' {path.expanduser('~/.config/sshyp/tmp')}")
|
||||||
|
|||||||
Reference in New Issue
Block a user