Fix export command to support literal values in env section #13
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.
Problem
The
crumb exportcommand was not exporting environment variables when theenvsection in.crumb.yamlcontained literal values. For example, with this configuration:Running
crumb export --env livewould not exportDB_TYPE, even though it's defined in theenvsection.Root Cause
The export command treated all values in the
envsection as paths to secrets in the encrypted storage. When it encounteredDB_TYPE: "postgres", it tried to look up a secret at the path"postgres"(which doesn't exist), and silently skipped it when the lookup failed.Solution
Modified the export command to distinguish between two types of values in the
envsection:/) - looked up in encrypted secrets storage (existing behavior)/) - used directly as-is (new behavior)This allows
.crumb.yamlto specify both:DB_TYPE: "postgres")SECRET_KEY: "/contacts/live/secret")Example
With the fix, the same configuration now exports correctly:
Changes
ExportCommandinpkg/commands/commands.goto check if env values start with/TestExportCommandLiteralEnvValuesTesting
Fixes #[issue-number]
Original prompt
Fixes #12
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.