publish update.py

This commit is contained in:
brockdarnold 2026-06-14 07:30:03 +00:00
parent 3252e94149
commit 4289e65e6f

View file

@ -51,6 +51,13 @@ def ensure_config():
print("• created config.ini from example (webhook prefilled).")
else:
print("• config.ini exists — your settings + OCR snip left untouched.")
# heal a UTF-8 BOM left by the old PowerShell installer (breaks configparser)
with open(cfg, "rb") as fh:
raw = fh.read()
if raw.startswith(b"\xef\xbb\xbf"):
with open(cfg, "wb") as fh:
fh.write(raw[3:])
print("• stripped a UTF-8 BOM from config.ini (old-installer leftover).")
return cfg, first
@ -101,7 +108,7 @@ def start_watchers(cfg_path):
run(["powershell", "-ExecutionPolicy", "Bypass", "-File",
os.path.join(HERE, "start-all.ps1")])
cp = configparser.ConfigParser()
cp.read(cfg_path)
cp.read(cfg_path, encoding="utf-8-sig")
if cp.get("watcher", "mode", fallback="ocr") == "ocr" and \
not cp.get("ocr", "region", fallback="").strip():
print("\n >> ONE-TIME (per PC) for hold/compress/stall alerts, run once:\n"