Skip to content

fix: gracefully handle missing config file#75

Open
nguyenquockhang1610 wants to merge 1 commit into
ApexOpsStudio:mainfrom
nguyenquockhang1610:fix/config-missing-crash
Open

fix: gracefully handle missing config file#75
nguyenquockhang1610 wants to merge 1 commit into
ApexOpsStudio:mainfrom
nguyenquockhang1610:fix/config-missing-crash

Conversation

@nguyenquockhang1610
Copy link
Copy Markdown

Summary

Fixes crash when ~/.config/task-cli/config.yaml is missing (#2).

Changes

  • load_config() now creates the config directory and writes a sensible default config when the file does not exist
  • Added .gitignore for __pycache__
  • Added tests for both missing and existing config scenarios

Testing

$ python3 -m pytest test_task.py -v
test_task.py::test_validate_description PASSED
test_task.py::test_validate_task_id PASSED
test_task.py::test_load_config_creates_default_when_missing PASSED
test_task.py::test_load_config_reads_existing PASSED
4 passed

Closes #2

When ~/.config/task-cli/config.yaml is missing, load_config() now
creates the directory and writes a sensible default config instead
of crashing with FileNotFoundError.

Added tests for both missing and existing config scenarios.

Closes 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