fix: create default config when missing instead of crashing (closes #2)#23
Open
chengfei-gh wants to merge 1 commit intoApexOpsStudio:mainfrom
Open
fix: create default config when missing instead of crashing (closes #2)#23chengfei-gh wants to merge 1 commit intoApexOpsStudio:mainfrom
chengfei-gh wants to merge 1 commit intoApexOpsStudio:mainfrom
Conversation
Fixes ApexOpsStudio#2 Changes: - load_config() now creates default config.yaml if missing - Creates ~/.config/task-cli/ directory if it doesn't exist - Prints helpful message when creating default config - Uses sensible defaults matching config.yaml.example Previously: FileNotFoundError with ugly stack trace Now: Creates config automatically and continues Tests: - rm ~/.config/task-cli/config.yaml && python task.py list → works - All existing tests still pass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix for #2: Crash when config file missing
Problem
python task.py listcrashes withFileNotFoundErrorwhen~/.config/task-cli/config.yamldoesn't exist.Solution
load_config()now automatically creates a default config file if missing:~/.config/task-cli/directory if neededconfig.yaml.example[task-cli] Created default config at ...Changes
load_config()intask.pywith graceful config creationDEFAULT_CONFIGconstant with default settingsTesting
Acceptance Criteria
Payment
Solana wallet:
CZkLs4m55JBffoowGUtyfqb5GrymUVxgr9kMTrXKfbJV