Skip to content

Commit

Permalink
add commit/push to sign/publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Mar 5, 2018
1 parent 9b2a490 commit d8b629f
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions dist/firefox/publish-signed-beta.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,19 @@
f.close()
updates_json = template_json.substitute(version=version)
with open(updates_json_filepath, 'w') as f:
f.write(updates_json)
f.close()
# TODO: automatically git add/commit?
f.write(updates_json)
f.close()
# Automatically git add/commit if needed.
# - Stage the changed file
r = subprocess.run(['git', 'status', '-s', updates_json_filepath], stdout=subprocess.PIPE)
rout = bytes.decode(r.stdout).strip()
if len(rout) >= 2 and rout[1] == 'M':
subprocess.run(['git', 'add', updates_json_filepath])
# - Commit the staged file
r = subprocess.run(['git', 'status', '-s', updates_json_filepath], stdout=subprocess.PIPE)
rout = bytes.decode(r.stdout).strip()
if len(rout) >= 2 and rout[0] == 'M':
subprocess.run(['git', 'commit', '-m', 'make Firefox dev build auto-update', updates_json_filepath])
subprocess.run(['git', 'push', 'origin', 'master'])

print('All done.')

0 comments on commit d8b629f

Please sign in to comment.