forked from chatty/chatty
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathversion.py
More file actions
35 lines (28 loc) · 795 Bytes
/
version.py
File metadata and controls
35 lines (28 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import re
import sys
# Check if at least one argument is provided
if len(sys.argv) > 1:
first_argument = sys.argv[1]
print(f"First argument: {first_argument}")
else:
print("No arguments provided.")
partVersion = '0.28.0';
finalVersion = f"{partVersion}.{first_argument}";
path = "src/chatty/Chatty.java";
chatty = open(path, 'r');
line = chatty.read();
chatty.close();
if not line:
exit(1);
chatty = open(path, 'w');
line = re.sub(
rf"public static final String VERSION = \"{partVersion}.[0-9]+",
f"public static final String VERSION = \"{finalVersion}",
line
);
#print(line)
chatty.write(line);
chatty.close();
open('final_version.txt', 'w').write(finalVersion);
#alias b='./gradlew build && ./gradlew packageAppArm'
#alias o='open ./build/jpackage-mac/Chatty-arm64.app'