X-Git-Url: https://projects.mako.cc/source/iron-blogger/blobdiff_plain/1c8a87b02aae31b111907415779d7df230357a24..a62186167d0f2c82668c5e10df438391e3a84f01:/weekly-update.py diff --git a/weekly-update.py b/weekly-update.py index acfc17b..f55c69c 100755 --- a/weekly-update.py +++ b/weekly-update.py @@ -77,9 +77,17 @@ if punt: bloggers = yaml.safe_load(b) for p in punt: if 'end' not in bloggers[p]: - bloggers[p]['end'] = today + bloggers[p]['end'] = date with open('bloggers.yml','w') as b: yaml.safe_dump(bloggers, b) - subprocess.check_call(["git", "commit", "ledger", "bloggers.yml", - "-m", "Punts for %s" % (today,)]) + if not dry_run: + subprocess.check_call(["git", "commit", "ledger", "bloggers.yml", + "-m", "Punts for %s" % (date,)]) + +# if it's a dry run, lets set the ledger back to the beginning state +if dry_run: + subprocess.check_call(["git", "checkout", "ledger"]) + + if punt: + subprocess.check_call(["git", "checkout", "bloggers.yml"])