disable interactive prompts and log configuration errors during automated prelaunch or injection sequences

This commit is contained in:
CPTN Cosmo 2026-04-18 15:43:33 +02:00
parent 869c2927d3
commit 58508465c7

View file

@ -439,9 +439,17 @@ def main():
print(f"Warning: Could not save updated config: {e}") print(f"Warning: Could not save updated config: {e}")
# Retrieve Secret (Keyring refactor) # Retrieve Secret (Keyring refactor)
secret = get_secret(config, config_path) secret = get_secret(config, config_path, allow_prompt=not (args.prelaunch or args.inject_only))
if not secret: if not secret:
if args.prelaunch or args.inject_only:
error_log = os.path.join(config_dir, 'error.log')
try:
with open(error_log, 'a') as f:
f.write(f"[{time.strftime('%Y-%m-%d %H:%M:%S')}] Error: OTP secret not configured.\n")
f.write("Please run 'xivlauncher-wrapper' manually from your terminal or application menu to configure your secret before launching via Steam.\n\n")
except Exception:
pass
print("Error: No secret available.") print("Error: No secret available.")
sys.exit(1) sys.exit(1)