-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
46 lines (39 loc) · 1.46 KB
/
main.py
File metadata and controls
46 lines (39 loc) · 1.46 KB
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
36
37
38
39
40
41
42
43
44
45
46
###########################################
# Author: calebeden
# File: main.py
# Created on Fri Jun 17 2022
###########################################
import microblocks
import mobheads
import json
from subprocess import Popen
from time import sleep
2
def main():
option = input("Which version number would you like to increase? 0=Major 1=Minor 2=Patch ")
while option not in ("0","1","2"):
print(f"{option} is not a valid option. Please try again.")
option = input("Which version number would you like to increase? 0=Major 1=Minor 2=Patch ")
with open('version.json', 'r') as infile:
previous_version = json.load(infile)
version = [0,0,0]
match option:
case "0":
version[0] = previous_version[0] + 1
case "1":
version[0] = previous_version[0]
version[1] = previous_version[1] + 1
case "2":
version[0] = previous_version[0]
version[1] = previous_version[1]
version[2] = previous_version[2] + 1
verify = input(f"Are you sure you want to change from version {previous_version} to {version} (y or n) ")
if verify.lower() == 'y':
with open("version.json", "w") as outfile:
json.dump(version, outfile)
mobheads.main()
microblocks.main()
Popen(r'explorer "C:\Users\ceden\Documents\Software Development\Python\Player Heads\Compiled Packs"')
sleep(1)
if __name__ == "__main__":
main()