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

Add support for options in environment variables #289

Merged
merged 4 commits into from Dec 17, 2021

Conversation

aidansteele
Copy link
Contributor

This uses yargs' support for providing option values via the command line: https://github.com/yargs/yargs/blob/main/docs/api.md#envprefix

My use case is that in CI scenarios I want raw output, but locally I want prefixes. I could duplicate all the scripts in my package.json: one with concurrently -r, one without - but I feel that is suboptimal and could lead to mistakes when devs forget to keep them in sync.

With this change, my CI script can now look like:

set -eux
export CONCURRENTLY_RAW=true 

npm run check
npm run validate
npm run build-all
# etc..

This uses yargs' support for providing option values via the command 
line:  https://github.com/yargs/yargs/blob/main/docs/api.md#envprefix
@coveralls
Copy link

coveralls commented Oct 4, 2021

Coverage Status

Coverage remained the same at 99.807% when pulling 4966bdc on aidansteele:patch-1 into c04740a on open-cli-tools:master.

Copy link
Member

@gustavohenke gustavohenke left a comment

Choose a reason for hiding this comment

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

oooh this is an awesome feature!! Great idea!

Do you think that we could have some docs and possibly some tests too?

@aidansteele
Copy link
Contributor Author

Sure thing, I'll try add those today :)

Copy link
Member

@gustavohenke gustavohenke left a comment

Choose a reason for hiding this comment

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

I've added the docs and skipped the tests for now, there's too much repetition in the binary spec file 😐

@gustavohenke gustavohenke merged commit 7578774 into open-cli-tools:master Dec 17, 2021
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.

None yet

3 participants