File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change 11import json
22import time
3+ from pathlib import Path
34
45from Updater .config .yml_loader import get_config
6+ from Updater .updater .assets .name import get_package_name_from_current_machine
57from Updater .updater .runner .process import find_processes_by_path , try_terminate
68from Updater .updater .tag .reader import read
7- from Updater .updater .tag .writer import write
89from fetch .github_release_api import fetch_latest_release
910from proxy .http import get_proxies
1011
1112OWNER = "Sn0wo2"
1213REPO = "QuickNote"
1314INTERVAL = 5.0
1415
16+
1517def main ():
1618 result = fetch_latest_release (OWNER , REPO , get_proxies ())
1719 print (json .dumps (
@@ -24,16 +26,28 @@ def main():
2426 print ("=" * 80 )
2527 print (f"New tag: { tag } " )
2628
27- procs = find_processes_by_path (get_config ().path .processPath )
29+ procs = find_processes_by_path (Path ( get_config ().path .workPath , get_config (). path . processName ) )
2830 if not procs :
2931 print ("No matching processes found." )
3032 for proc in procs :
3133 try_terminate (proc )
3234
33- write (tag )
35+ download_url = None
36+
37+ for asset in result .get ("assets" ):
38+ if asset .get ("name" ) == get_package_name_from_current_machine ():
39+ download_url = asset .get ("browser_download_url" )
40+ break
41+
42+ if download_url is None :
43+ print (f"Could not find asset for { get_package_name_from_current_machine ()} " )
44+ return
45+
46+ print (download_url )
3447
3548 print ("=" * 80 )
3649 time .sleep (INTERVAL )
3750
51+
3852if __name__ == "__main__" :
3953 main ()
You can’t perform that action at this time.
0 commit comments