Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for swa-cli.config.json file #294

Merged
merged 3 commits into from
Sep 27, 2021

Conversation

alexweininger
Copy link
Contributor

@alexweininger alexweininger commented Sep 10, 2021

Feature:

This feature works as described by @anthonychu in #20 (comment).

  • If only one configuration present in config file, running swa start will use this configuration.
  • Otherwise you must use swa start <config name> to use a configuration. If <config name> is not found in the config file, no config will be used.
  • Added the --config option, which allows the user to specify a specific path to a config file to use.
  • Added the --print-config options, which prints the picked up configuration. Useful for user debugging.

I've updated the readme to document how to use a config file.

One thing to note: this feature can only either take options from the command line or the config file. It cannot merge or mix options. If a configuration from the config file is picked up and used no options passed in via command line will be respected.

This is a limitation of commander. More details at: tj/commander.js#1584

I've also created a JSON Schema for the swa-cli.config.json file.

Tests:

  • Added unit tests
  • Added e2e tests that function the same as the current e2e test, except use a config file rather than options passed in via terminal. Run these with npm run e2e:config

Closes #20

@alexweininger alexweininger changed the title Add support for swa-cli.config.json file feat: Add support for swa-cli.config.json file Sep 10, 2021
@github-actions github-actions bot added the scope: cli Issues happened a the ./src/cli level label Sep 10, 2021
@manekinekko manekinekko self-requested a review September 25, 2021 12:30
Copy link
Member

@manekinekko manekinekko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. cc @Reshmi-Sriram

@manekinekko manekinekko added the pr: lgtm A PR has been reviewed (CI is green) and is ready to be merged label Sep 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: lgtm A PR has been reviewed (CI is green) and is ready to be merged scope: cli Issues happened a the ./src/cli level
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add swa.json config file
4 participants