django-select2/set_version.py
Thomas Grainger e4efaab6f1 Fix automated NPM deployment process (#505)
Use skip_cleanup to distribute build artifacts.
2018-08-23 18:59:21 +02:00

12 lines
326 B
Python
Executable file

#!/usr/bin/env python3
"""Set the version in NPM's package.json to match the git tag."""
import json
import os
if __name__ == '__main__':
with open('package.json', 'r+') as f:
data = json.load(f)
f.seek(0)
data['version'] = os.environ['TRAVIS_TAG']
json.dump(data, f)
f.truncate()