Skip to content

Commit

Permalink
Add option for force update; unknown if actually needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
awickert committed May 24, 2024
1 parent bb0cbba commit 01804c4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions aggregate_NorthernWidget_dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import shutil
import glob
from datetime import datetime
import sys

outgit_directory = 'NWraw'
all_libs_directory_git = 'NorthernWidget-libraries'
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 01804c4

Please sign in to comment.