Repository navigation
feat: read config from ~/.config/stackdog and add stackdog init - #26
Merged
Merged
Conversation
Configuration resolution, nearest first: real environment variables, then ./.env in the working directory, then ~/.config/stackdog/.env ($XDG_CONFIG_HOME/stackdog/.env when set). dotenvy never overrides an already-set variable, so the nearest file wins. A missing file is no longer a warning: every setting has a default. stackdog init writes the starter config to the config directory and never overwrites an existing file, since it holds credentials. The template is the repo's .env.sample, embedded in the binary so it works for cargo install and brew, where no sample file sits next to the binary. Verified by hand against a throwaway HOME: init creates the file, a second run reports it exists and leaves it alone. 469+8+108 tests pass, clippy -D warnings and fmt clean.
Author
|
@copilot resolve the merge conflicts in this pull request |
# Conflicts: # CHANGELOG.md Co-authored-by: vsilent <42473+vsilent@users.noreply.github.com>
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.
.envin the working directory >~/.config/stackdog/.env($XDG_CONFIG_HOME/stackdog/.envwhen set). dotenvy never overrides an already-set variable, so the nearest file wins. A missing file is no longer a warning — every setting has a default.stackdog init: writes the starter config to that directory and never overwrites an existing file (it holds credentials). The template is the repo's.env.sample, embedded in the binary (include_str!), so it works forcargo installand brew where no sample file sits next to the binary..env.sample, CHANGELOG.Context: after
cargo installorbrew installno.envis created anywhere (binary only). This turns the manualcp .env.sample .envinto one command with a canonical location. No auto-creation on install, by decision.