(relpath, newversion)
| 52 | |
| 53 | |
| 54 | def update_package_json(relpath, newversion): |
| 55 | p = pathlib.Path(relpath) |
| 56 | assert p.exists() |
| 57 | with open(p) as f: |
| 58 | json_data = json.loads(f.read()) |
| 59 | json_data["version"] = newversion |
| 60 | with open(p, "w") as f: |
| 61 | json.dump(json_data, f, sort_keys=True, indent=2) |
| 62 | f.write("\n") |
| 63 | |
| 64 | |
| 65 | def main(): |