Skip to content

Instantly share code, notes, and snippets.

@punit-kulal
Created August 23, 2023 09:11
Show Gist options
  • Save punit-kulal/fb48e287e5952e6de3598ada05f68d32 to your computer and use it in GitHub Desktop.
Save punit-kulal/fb48e287e5952e6de3598ada05f68d32 to your computer and use it in GitHub Desktop.
script which bumps a package.json to the provided version
import json
import sys
dir_path = sys.argv[1]
version = sys.argv[2]
# Opening JSON file
with open(dir_path+"/package.json", 'r+') as f:
data = json.load(f)
data["version"] = version
f.seek(0)
json.dump(data, f)
f.truncate()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment