if-ci
v3.0.0
Published
Easily run npm scripts only when in (or not in) a CI environment.
Downloads
2,989
Readme
if-ci ·
Easily run npm scripts only when in (or not in) a CI environment.
installation
npm i --save-dev if-ci
usage
if-ci
ships with two commands, the obvious if-ci
as well as if-not-ci
.
To use them, just prepend them to any existing command in an npm script.
if-ci
Will only run the given command when in a CI environment.
{
"name": "my-great-package",
"version": "1.2.34",
"scripts": {
"maybeEcho": "if-ci echo \"hello!\""
}
}
If you have multiple commands in a script, just use it again:
{
"name": "my-great-package",
"version": "1.2.34",
"scripts": {
"maybeEcho": "if-ci echo \"hello\" && if-ci echo \"world!\""
}
}
if-not-ci
Works inversely to if-ci
and will only run the given command when
not in a CI environment.
{
"name": "my-great-package",
"version": "1.2.34",
"scripts": {
"maybeEcho": "if-not-ci echo \"hello\" && if-not-ci echo \"world!\""
}
}
contributing
Pull requests and any issues found are always welcome.
- Fork the project, and preferably create a branch named something like
feat-make-better
- Modify as needed
- Make sure all tests continue to pass, and it never hurts to have more tests
- Push & pull request! :tada:
license
MIT © Bo Lingen / citycide