Skip to content

Commit

Permalink
Regenerate the manifest file if the runner encounters a ManifestVersi…
Browse files Browse the repository at this point in the history
…onMismatch (#148)
  • Loading branch information
jgraham authored and gsnedders committed Jan 9, 2017
1 parent 882fcef commit 8e71a10
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions runner/update_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,21 @@

root = localpaths.repo_root

import manifest
from manifest import manifest, update

def main(request, response):
path = os.path.join(root, "MANIFEST.json")
manifest_file = manifest.manifest.load(root, path)

manifest_file = None
try:
manifest_file = manifest.load(root, path)
except manifest.ManifestVersionMismatch:
pass
if manifest_file is None:
manifest_file = manifest.manifest.Manifest("/")
manifest_file = manifest.Manifest("/")

update.update(root, manifest_file)

manifest.update.update(root, manifest_file)
manifest.manifest.write(manifest_file, path)
manifest.write(manifest_file, path)

return [("Content-Type", "application/json")], json.dumps({"url": "/MANIFEST.json"})

0 comments on commit 8e71a10

Please sign in to comment.