From c9546beefadafb4761a5816b738faae6df421469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferit=20Yi=C4=9Fit=20BALABAN?= Date: Thu, 9 Feb 2023 14:33:39 +0300 Subject: [PATCH] Map out logic if exists_dir_repo is True --- dotman.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dotman.py b/dotman.py index fdf8154..8106c48 100755 --- a/dotman.py +++ b/dotman.py @@ -211,6 +211,25 @@ def main(): if exists_dir_repo: # local repository directory exists. Backup or deploy is possible. + if flag_interactive: + # if interactive flag was fed, ignore backup and deploy key + # ask user for action (backup or deploy) + ans = input('(B)ackup or (D)eploy is possible, select one: ') + if ans.lower() = 'b': + # interactive backup + elif ans.lower() = 'd': + # interactive deploy + else: + # ask again + else: + # continue according to set flag, XOR + if flag_backup and not flag_deploy: + # backup + elif flag_deploy and not flag_backup: + # deploy + else: + # either both flags are set OR both are unset + # quit script else: # local repository directory does not exist. Only deploy is possible.