* Fix detection of orphaned script and clarify the exception
This commit is contained in:
LoafyLemon 2024-04-28 13:43:47 +01:00
parent e295fbb791
commit 8aa1a84efb
1 changed files with 14 additions and 15 deletions

View File

@ -26,26 +26,25 @@ python early:
UNDERLINE = '\033[4;37;48m'
END = '\033[1;37;0m'
if config.developer:
# Debug
# Debug
# Note: config.developer flag is set to False during early initialisation
def detect_orphaned_rpyc_files():
excluded = ["tl/", "00db.rpyc", "00sshtransition.rpyc"]
def detect_orphaned_rpyc_files():
excluded = ["tl/"]
files = renpy.list_files(common=True)
files = renpy.list_files(common=True)
compiled = [x for x in files if x.endswith(".rpyc") if not any(x.startswith(i) for i in excluded)]
scripts = [x for x in files if x.endswith(".rpy")]
orphaned = []
compiled = [x for x in files if x.endswith(".rpyc") if not any(x.startswith(i) for i in excluded)]
scripts = [x for x in files if x.endswith(".rpy")]
orphaned = []
for i in compiled:
if not i[:-1] in scripts:
orphaned.append(i)
for i in compiled:
if not i[:-1] in scripts:
orphaned.append(i)
if orphaned:
raise Exception(f"Orphaned compiled scripts detected, please delete them before continuing:\n{orphaned}")
detect_orphaned_rpyc_files()
if orphaned:
raise Exception(f"Orphaned compiled scripts detected, please force recompile in Ren'py Launcher before continuing:\n{orphaned}")
detect_orphaned_rpyc_files()
# class InstanceDebugger(object):