Skip to content

Fix: Handle missing config file gracefully (Issue #2)#50

Open
Guaiyu11 wants to merge 1 commit intoApexOpsStudio:mainfrom
Guaiyu11:fix/config-missing
Open

Fix: Handle missing config file gracefully (Issue #2)#50
Guaiyu11 wants to merge 1 commit intoApexOpsStudio:mainfrom
Guaiyu11:fix/config-missing

Conversation

@Guaiyu11
Copy link
Copy Markdown

Summary

Fixes crash when ~/.config/task-cli/config.yaml is missing.

Changes

  • load_config(): Returns None instead of crashing when config missing
  • ensure_config(): Creates default config if missing (copies from config.yaml.example or creates minimal default)
  • ensure_config() called before each command to prevent any crash

Behavior

  • Before: FileNotFoundError: [Errno 2] No such file: 'C:\Users\...\.config\task-cli\config.yaml'
  • After: Gracefully creates default config, commands work normally

Test

rm -rf ~/.config/task-cli
python task.py add "test"  # No crash, works fine

Closes #2
/claim #2

- load_config() now returns None instead of crashing
- ensure_config() creates default config if missing
- Called before each command to prevent crashes

Closes ApexOpsStudio#2
/claim ApexOpsStudio#2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix: Crash when config file missing

1 participant