File: set_version.py

package info (click to toggle)
django-select2 7.10.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 452 kB
  • sloc: python: 1,654; javascript: 66; makefile: 3
file content (12 lines) | stat: -rwxr-xr-x 342 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
#!/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["GITHUB_REF"].rsplit("/")[-1]
        json.dump(data, f)
        f.truncate()