From 1a5570664e20c20b9a889e73c05054aa5f26095e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferit=20Yi=C4=9Fit=20BALABAN?= Date: Thu, 9 Feb 2023 14:10:48 +0300 Subject: [PATCH] Add method create_deploy_list --- dotman.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dotman.py b/dotman.py index d902f77..4c98060 100755 --- a/dotman.py +++ b/dotman.py @@ -67,13 +67,21 @@ def read_deploy_list(): dict_deploy_list = json.loads(file) DL_FILES = dict_deploy_list['files'] DL_DIRS = dict_deploy_list['dirs'] + else: + create_deploy_list() def create_deploy_list(): """ Creates the default deploy_list.json in path SETTINGS.F_DEPLOY """ - default = {} + dl_default = { + "files": [], + "dirs": ["dotman"], + } + with open(SETTINGS['F_DEPLOY'], 'w') as f: + f.write(json.dumps(dl_default, indent = 4)) + f.close() def rrem(text: str, char: str):