Skip to content

Commit

Permalink
pr suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: pSchlarb <[email protected]>
  • Loading branch information
pSchlarb committed Jan 11, 2023
1 parent cf91781 commit 8481dd9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions updateVersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
group.add_argument("--timestamp", help="Timestamp to be set for the version")
group.add_argument("--getVersion", help="Prints the current version", action="store_true")
args = vars(ap.parse_args())

sovrinMetadata = 'sovrin/metadata.json'

def updateWithTag(ver):
if not semver.VersionInfo.isvalid(ver):
Expand All @@ -19,7 +19,7 @@ def updateWithTag(ver):

def updateWithTimestamp(timestamp):
version = "str"
with open('sovrin/metadata.json', 'r') as f:
with open(sovrinMetadata, 'r') as f:
data = json.load(f)
v = semver.VersionInfo.parse(data["version"])
v = v.replace(prerelease="dev" + timestamp)
Expand All @@ -30,7 +30,7 @@ def updateWithTimestamp(timestamp):
version = "string"

if args['getVersion']:
with open('sovrin/metadata.json', 'r') as f:
with open(sovrinMetadata, 'r') as f:
data = json.load(f)
v = semver.VersionInfo.parse(data["version"])
print(v)
Expand All @@ -46,10 +46,10 @@ def updateWithTimestamp(timestamp):
ap.print_help()
quit()

with open('sovrin/metadata.json', 'r') as f:
with open(sovrinMetadata, 'r') as f:
data = json.load(f)
data["version"] = version
json.dump(data, open("sovrin/metadata.json", "w"), indent=2)
json.dump(data, open(sovrinMetadata, "w"), indent=2)


print("Updated version of sovtoken and sovtokenfees metadata.json to: ", version)
print("Updated version of sovrin metadata.json to: ", version)

0 comments on commit 8481dd9

Please sign in to comment.