From 01804c4509477fafb5af42dd8357eb4575a93bbc Mon Sep 17 00:00:00 2001 From: awickert Date: Fri, 24 May 2024 15:08:56 -0500 Subject: [PATCH] Add option for force update; unknown if actually needed. --- aggregate_NorthernWidget_dev.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aggregate_NorthernWidget_dev.py b/aggregate_NorthernWidget_dev.py index 573d808..86a2e66 100755 --- a/aggregate_NorthernWidget_dev.py +++ b/aggregate_NorthernWidget_dev.py @@ -14,6 +14,7 @@ import shutil import glob from datetime import datetime +import sys outgit_directory = 'NWraw' all_libs_directory_git = 'NorthernWidget-libraries' @@ -106,6 +107,17 @@ stagedChanges = repo.index.diff("HEAD") if len(stagedChanges) == 0: print("No files changed; no commit to make") + if len(sys.argv) > 1: + if sys.argv[1] == '-f': + print("Force committing as instructed.") + repo.index.commit(COMMIT_MESSAGE) + print("Commit message:", COMMIT_MESSAGE) + origin = repo.remote(name='origin') + origin.push() + else: + print("Pass the '-f' flag if you wnat to force a commit.") + else: + print("Pass the '-f' flag if you wnat to force a commit.") else: print("Committing and pushing changes") repo.index.commit(COMMIT_MESSAGE)