From 2b6004a7b35d55cbc606a8f62d33b1753a182ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferit=20Yi=C4=9Fit=20BALABAN?= Date: Fri, 10 Feb 2023 22:46:54 +0300 Subject: [PATCH] + logic for method backup() --- dotman.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/dotman.py b/dotman.py index a5b611b..d010b28 100755 --- a/dotman.py +++ b/dotman.py @@ -174,6 +174,23 @@ def commit_then_push(): return 1, None +def backup(): + """ + Aggresively executes the steps to do checksum comparisons between local + config directory and local repository to decide which files to copy, + copy only changed files, commit and push to remote. + """ + # get list of files and directories to change (F_DEPLOY) + # get list of checksums of (F_DEPLOY), compute and compare with local repository + # if checksum(local_config) != checksum(local_repo) + # copy local_config to local_repo + # if exists(local_config in local_repo) is False + # copy local_config to local_repo + # if exists(F_DEPLOY) but not in local_config + # warn for lost file, user must either copy from local_repo to local_config or delete from F_DEPLOY + # exec git commit -m "[message]" && git push + + def deploy(): """ Kindly executes the steps to get a up-to-date local repository,