# HG changeset patch # User Ludovic Chabant # Date 1494604911 25200 # Node ID bd269692dbb4cc520e55d2dd3172843e1ba2a6a0 # Parent 5e3e840b5574f986166a8f9309e2aee528e83999 cm: Make the release script commit changed FoodTruck assets if needed. diff -r 5e3e840b5574 -r bd269692dbb4 garcon/pypi.py --- a/garcon/pypi.py Sun Oct 29 23:13:12 2017 -0700 +++ b/garcon/pypi.py Fri May 12 09:01:51 2017 -0700 @@ -1,3 +1,4 @@ +import re from invoke import task, run @@ -14,12 +15,25 @@ print("Generating FoodTruck assets") run("gulp") + # See if any asset was modified and needs to be submitted. + r = run('hg status', hide=True) + if re.match(r'^[R\!] ', r.stdout): + raise Exception("FoodTruck assets are missing or were removed!") + + commit_assets = False + if re.match(r'^[MA] ', r.stdout): + commit_assets = True + # CHANGELOG.rst and documentation changelog page. run("invoke changelog --last %s" % version) run("invoke changelog --last %s -o docs/pages/support/changelog.md" % version) if not local_only: + if commit_assets: + run('hg commit piecrust/admin/static ' + '-m "admin: Regenerate FoodTruck assets."') + # Submit the CHANGELOG. run('hg commit CHANGELOG.rst docs/pages/support/changelog.md ' '-m "cm: Regenerate the CHANGELOG."') @@ -31,6 +45,8 @@ run("python setup.py version") run("python setup.py sdist upload") else: + if commit_assets: + print("Would submit FoodTruck assets...") print("Would submit changelog files...") print("Would tag repo with %s..." % version) print("Would upload to PyPi...")