Skip to content

Allow config override through --config or env.SOCKET_CLI_CONFIG#383

Merged
jdalton merged 3 commits intomainfrom
config_override
Mar 25, 2025
Merged

Allow config override through --config or env.SOCKET_CLI_CONFIG#383
jdalton merged 3 commits intomainfrom
config_override

Conversation

@pvdz
Copy link
Contributor

@pvdz pvdz commented Mar 25, 2025

This adds an option to override the local config through either an env var (SOCKET_CLI_CONFIG) or flag (--config).

When an override is used, config changes will not be persisted to disk.

The main goal is to add an easy way for tests to use different configs without having to set up heavy machinery for it. But it's also a common feature seen in other packages so why not.

This will add a hidden flag --config to almost all commands.

Drops process imports because that's an auto-global in nodejs.

All tests are updated to use --config {}, where supported. Lots of churn in the test files as a result. Would ignore that in the review.

This PR also fixes a bunch of the dry-run tests 🙈 because they were still using --help.

@pvdz pvdz requested a review from jdalton March 25, 2025 15:13
@jdalton jdalton merged commit 2b3eff9 into main Mar 25, 2025
17 checks passed
@jdalton jdalton deleted the config_override branch March 25, 2025 16:36
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.

2 participants