Stop a config.yaml typo from wiping the config (#6) #24
Loading…
Reference in a new issue
No description provided.
Delete branch "eric/fix-6-config-parse-error"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #6
Problem: if
config.yamldidn't parse, the app overwrote it with defaults. You'd lose the database location, player and theme, and get first-time setup again. The app could also write a config it couldn't read back: values were written without quoting, so a Windows path, or a player command with#or:, broke parsing on the next start.Fix:
load_config(replacingread_config) returns an error when the file can't be read or parsed, and never touches the file.mainprints the error and exits before the full-screen UI starts:serde_yaml, so it's quoted only when needed. Ordinary values look the same as before. One small visible change:db_locationandlog_fileare no longer always wrapped in double quotes.I chose exiting over "use defaults for this session only", because a session with defaults has no database location. It would go into first-time setup, which saves the config and overwrites your file anyway.
Testing:
#1:in it, and the wordnull.buffer_performance_tests(timing limits, #12).🤖 Generated with Claude Code
https://claude.ai/code/session_01E2XefpQijvBcJBfgzuaoWA