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)