Created
August 23, 2023 09:11
-
-
Save punit-kulal/fb48e287e5952e6de3598ada05f68d32 to your computer and use it in GitHub Desktop.
script which bumps a package.json to the provided version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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