Skip to content

Commit

Permalink
FIx update function
Browse files Browse the repository at this point in the history
  • Loading branch information
dmcdo committed Feb 13, 2023
1 parent 6218109 commit bb59449
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/globals.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = "v0.4.0"
VERSION = "v0.4.1"
10 changes: 8 additions & 2 deletions src/system/update.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import subprocess
import sys
import re
import os
import tempfile
import requests
import hashlib
Expand Down Expand Up @@ -53,7 +54,12 @@ def update(release: GitRelease, asset: GitReleaseAsset):

with open(p, "wb") as f:
f.write(r.content)
if platform != "win32":

if platform == "win32":
subprocess.Popen([p], creationflags=subprocess.CREATE_NEW_CONSOLE)
sys.exit(0)
else:
subprocess.run(["chmod", "+x", p], shell=False)
os.execl(p, p)

subprocess.run([p], shell=sys.platform == "win32")
raise RuntimeError("This state should not be possible.")

0 comments on commit bb59449

Please sign in to comment.