This commit is contained in:
Ferit Yiğit BALABAN 2022-04-19 23:48:10 +03:00
parent 93aa9eeb21
commit d3c4372144
2 changed files with 12 additions and 1 deletions

View File

@ -18,7 +18,7 @@ SETTINGS = {
} }
WHEREAMI = '$HOME/scripts' WHEREAMI = '$HOME/scripts'
VER = 'v1.7' VER = 'v1.7'
WER = 'v1' WER = 'v1.1'
help_message = f''' help_message = f'''
dotman {VER} dotfiles manager by fyb dotman {VER} dotfiles manager by fyb
@ -60,6 +60,10 @@ def read_setup():
SETTINGS[key] = value SETTINGS[key] = value
def write_setup():
path = f'{WHEREAMI}setup.dtm' if SETTINGS['SETUP_FILE'] == 'same-directory' else os.path.expandvars(SETTINGS['SETUP_FILE'])
def rrem(text: str, char: str): def rrem(text: str, char: str):
""" """
Remove characters from right until character supplied with char Remove characters from right until character supplied with char
@ -246,6 +250,8 @@ def main():
elif num.isnumeric() and 1 <= int(num) <= len(SETTINGS): elif num.isnumeric() and 1 <= int(num) <= len(SETTINGS):
key = get_nth_key(int(num) - 1, SETTINGS) key = get_nth_key(int(num) - 1, SETTINGS)
SETTINGS[key] = input(f'Enter new value for {key}: ').strip() SETTINGS[key] = input(f'Enter new value for {key}: ').strip()
print('Saving changes to file')
write_setup()
elif flag_version: elif flag_version:
print(f'dotman version: {VER.removeprefix("v")}') print(f'dotman version: {VER.removeprefix("v")}')

5
setup.dtm Normal file
View File

@ -0,0 +1,5 @@
# setup file for dotman v1.8
DOTFILES_REPOSITORY:$HOME/repos/dotfiles
REMOTE_REPOSITORY:https://github.com/fybx/dotfiles
LOCAL_CONFIG:$HOME/.config
SETUP_FILE:same-directory