From 8481dd9bed13fdc0d310611699e0899cd093b255 Mon Sep 17 00:00:00 2001
From: pSchlarb
Date: Wed, 11 Jan 2023 12:08:11 +0100
Subject: [PATCH] pr suggestions
Signed-off-by: pSchlarb
---
updateVersion.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/updateVersion.py b/updateVersion.py
index f6fc2e38..2f7b1ae5 100644
--- a/updateVersion.py
+++ b/updateVersion.py
@@ -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):
@@ -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)
@@ -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)
@@ -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)
\ No newline at end of file
+print("Updated version of sovrin metadata.json to: ", version)
\ No newline at end of file