Skip to content

Commit

Permalink
New version is not overwritten
Browse files Browse the repository at this point in the history
  • Loading branch information
YT-Advanced authored Nov 9, 2023
1 parent 87dcb12 commit 3e452d9
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions scripts/WSAUpdateChecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def MagiskandGappsChecker(type):
# Write for pushing later
file = open('../' + type + '.appversion', 'w')
file.write(currentver)
file.close()
if new_version_found:
return 0;

Expand All @@ -70,10 +69,16 @@ def MagiskandGappsChecker(type):
# Check if version is the same or not
if (currentver != latestver):
print("New version found: " + latestver)
subprocess.Popen(git, shell=True, stdout=None, stderr=None, executable='/bin/bash').wait()
new_version_found = True
# Write appversion content
subprocess.Popen(git, shell=True, stdout=None, stderr=None, executable='/bin/bash').wait()
file.seek(0)
file.truncate()
file.write(latestver)
# Write Github Environment
with open(env_file, "a") as wr:
wr.write("SHOULD_BUILD=yes\nMSG=" + msg)
file.close()

def WSAChecker(user, release_type):
global new_version_found
Expand All @@ -82,7 +87,6 @@ def WSAChecker(user, release_type):
# Write for pushing later
file = open('../' + release_type + '.appversion', 'w')
file.write(currentver)
file.close()

if new_version_found:
return 0;
Expand Down Expand Up @@ -150,11 +154,17 @@ def WSAChecker(user, release_type):
# Check new WSA version
if version.parse(currentver) < version.parse(wsa_build_ver):
print("New version found: " + wsa_build_ver)
new_version_found = True
# Write appversion content
subprocess.Popen(git, shell=True, stdout=None, stderr=None, executable='/bin/bash').wait()
file.seek(0)
file.truncate()
file.write(wsa_build_ver)
# Write Github Environment
msg = 'Update WSA Version from `v' + currentver + '` to `v' + wsa_build_ver + '`'
with open(env_file, "a") as wr:
wr.write("SHOULD_BUILD=yes\nRELEASE_TYPE=" + release_type + "\nMSG=" + msg)
new_version_found = True
file.close()

# Get user_code (Thanks to @bubbles-wow because of his repository)
users = {""}
Expand Down

0 comments on commit 3e452d9

Please sign in to comment.