From d3c43721443837fd8289fc2a768eccf04cd9987b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferit=20Yi=C4=9Fit=20BALABAN?= Date: Tue, 19 Apr 2022 23:48:10 +0300 Subject: [PATCH] WIP --- dotman.py | 8 +++++++- setup.dtm | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 setup.dtm diff --git a/dotman.py b/dotman.py index cc550a0..78ee254 100755 --- a/dotman.py +++ b/dotman.py @@ -18,7 +18,7 @@ SETTINGS = { } WHEREAMI = '$HOME/scripts' VER = 'v1.7' -WER = 'v1' +WER = 'v1.1' help_message = f''' dotman {VER} dotfiles manager by fyb @@ -60,6 +60,10 @@ def read_setup(): 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): """ Remove characters from right until character supplied with char @@ -246,6 +250,8 @@ def main(): elif num.isnumeric() and 1 <= int(num) <= len(SETTINGS): key = get_nth_key(int(num) - 1, SETTINGS) SETTINGS[key] = input(f'Enter new value for {key}: ').strip() + print('Saving changes to file') + write_setup() elif flag_version: print(f'dotman version: {VER.removeprefix("v")}') diff --git a/setup.dtm b/setup.dtm new file mode 100644 index 0000000..98cd44e --- /dev/null +++ b/setup.dtm @@ -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 \ No newline at end of file