feat: Run post_script

This commit is contained in:
Sayantan Santra 2023-08-10 14:52:58 -05:00
parent c56a97c733
commit b677e73a7c
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F

View file

@ -12,11 +12,12 @@ from datetime import datetime
from Notifications import send_notif from Notifications import send_notif
from Cleanup import * from Cleanup import *
import logging import logging
import subprocess
# TODO: Run post_script (preferably in any language) # TODO: Run post_script (preferably in any language)
# TODO: README # TODO: README
# TODO: PATCHES_GUIDE.md (maybe delete it?) # TODO: PATCHES_GUIDE.md (maybe delete it?)
# TODO: Make it PIP installable # TODO: Lockfile
# Update the ReVanced tools, if needed # Update the ReVanced tools, if needed
def update_tools(appstate): def update_tools(appstate):
@ -168,3 +169,7 @@ elif flag != ['checkonly']:
if flag != 'buildonly': if flag != 'buildonly':
with open('versions.json', 'w') as f: with open('versions.json', 'w') as f:
json.dump(appstate['present_vers'], f, indent=4) json.dump(appstate['present_vers'], f, indent=4)
try:
subprocess.run(f"{appstate['build_config']['post_script']['file']} {timestamp}", shell=True)
except:
pass