mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-08-29 13:26:30 -04:00
~/.config is created if it does not already exist
This commit is contained in:
+3
-5
@@ -4,19 +4,17 @@
|
||||
|
||||
# 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 sys import exit as s_exit
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
# utility functions
|
||||
|
||||
def get_titles_mods(_directory, _destination, _user_data):
|
||||
_title_list, _mod_list = [], []
|
||||
try: # create config directory
|
||||
mkdir(expanduser('~/.config/sshync'), 0o700)
|
||||
except FileExistsError:
|
||||
pass
|
||||
Path(path.expanduser('~/.config/sshync')).mkdir(0o700, parents=True, exist_ok=True) # create config directory
|
||||
# local fetching
|
||||
if _destination == 'l':
|
||||
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)
|
||||
except FileExistsError:
|
||||
pass
|
||||
try:
|
||||
mkdir(path.expanduser('~/.config/sshyp'), 0o700)
|
||||
except FileExistsError:
|
||||
pass
|
||||
Path(path.expanduser('~/.config/sshyp')).mkdir(0o700, parents=True, exist_ok=True)
|
||||
if not Path(f"{path.expanduser('~/.config/sshyp/tmp')}").exists():
|
||||
if Path("/data/data/com.termux").exists():
|
||||
system(f"ln -s '/data/data/com.termux/files/usr/tmp' {path.expanduser('~/.config/sshyp/tmp')}")
|
||||
|
||||
Reference in New Issue
Block a user