Add method create_deploy_list

This commit is contained in:
Ferit Yiğit BALABAN 2023-02-09 14:10:48 +03:00
parent 7de29c4333
commit 1a5570664e

View File

@ -67,13 +67,21 @@ def read_deploy_list():
dict_deploy_list = json.loads(file) dict_deploy_list = json.loads(file)
DL_FILES = dict_deploy_list['files'] DL_FILES = dict_deploy_list['files']
DL_DIRS = dict_deploy_list['dirs'] DL_DIRS = dict_deploy_list['dirs']
else:
create_deploy_list()
def create_deploy_list(): def create_deploy_list():
""" """
Creates the default deploy_list.json in path SETTINGS.F_DEPLOY 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): def rrem(text: str, char: str):