Skip to content

Commit

Permalink
Fixed issue with common.runStartup
Browse files Browse the repository at this point in the history
  • Loading branch information
Illidanz committed Aug 21, 2024
1 parent 476aaf6 commit 4d78fe7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hacktools/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.36.0"
__version__ = "0.36.1"
10 changes: 8 additions & 2 deletions hacktools/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import shlex
import shutil
import sys
import stat
import struct
import subprocess
import typing
Expand Down Expand Up @@ -430,7 +431,7 @@ def main(gui):
runGUI()


def runStartup():
def runStartup(skipcrc=False):
if datafolder != "" and not os.path.isdir(datafolder):
makeFolder(datafolder)
if appname != "":
Expand All @@ -441,7 +442,7 @@ def runStartup():
if filecheck != "" and not os.path.isfile(filecheck):
logError(filecheck, "file not found.")
return False
if crc >= 0 and not os.path.isfile(".skipcrc"):
if crc >= 0 and not skipcrc and not os.path.isfile(".skipcrc"):
checkcrc = crcFile(filecheck)
if crc != checkcrc:
logMessage("Checksum mismatch for", filecheck, "(" + toHex(checkcrc) + ", expected", toHex(crc) + ")")
Expand Down Expand Up @@ -1154,6 +1155,11 @@ def makeFolder(folder, clear=True):

def clearFolder(folder):
if os.path.isdir(folder):
# Ensure files aren't marked as read-only
for root, dirs, files in os.walk(folder, topdown=False):
for name in files:
filename = os.path.join(root, name)
os.chmod(filename, stat.S_IWUSR)
shutil.rmtree(folder)


Expand Down

0 comments on commit 4d78fe7

Please sign in to comment.