Fix two confirmed findings from full codebase audit
- patch_ui.py: wrap shutil.copy2 backup in try/except OSError so a permission or read-only filesystem error prints a specific diagnostic instead of crashing the script with a generic 'exited non-zero' message - install.sh: add early guard that detects pipe-install (bash <(curl ...)) and exits with a clear error pointing to the git clone workflow
This commit is contained in:
+5
-1
@@ -90,7 +90,11 @@ def main():
|
||||
|
||||
backup = path + ".pre-truecloud-patch"
|
||||
if not os.path.exists(backup):
|
||||
shutil.copy2(path, backup)
|
||||
try:
|
||||
shutil.copy2(path, backup)
|
||||
except OSError as exc:
|
||||
print(f"[truecloud-patch] ERROR: Could not create backup {backup}: {exc}")
|
||||
return
|
||||
|
||||
patched, count = FIND.subn(REPLACE, content)
|
||||
if count != 1:
|
||||
|
||||
Reference in New Issue
Block a user