diff --git a/.all-contributorsrc b/.all-contributorsrc
index 407a46c..bd2e5e9 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -407,6 +407,15 @@
"contributions": [
"code"
]
+ },
+ {
+ "login": "kevjin",
+ "name": "Kevin J",
+ "avatar_url": "https://avatars2.githubusercontent.com/u/15851351?v=4",
+ "profile": "https://github.com/kevjin",
+ "contributions": [
+ "code"
+ ]
}
],
"repoType": "github"
diff --git a/README.md b/README.md
index 075557b..ab6c851 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@ All the benefits of npm scripts without the cost of a bloated package.json and l
[![downloads][downloads-badge]][npm-stat]
[![MIT License][license-badge]][LICENSE]
-[![All Contributors](https://img.shields.io/badge/all_contributors-40-orange.svg?style=flat-square)](#contributors)
+[![All Contributors](https://img.shields.io/badge/all_contributors-41-orange.svg?style=flat-square)](#contributors)
[![PRs Welcome][prs-badge]][prs]
[![Donate][donate-badge]][donate]
[![Code of Conduct][coc-badge]][coc]
@@ -489,7 +489,7 @@ Thanks goes to these people ([emoji key][emojis]):
| [
Sorin Muntean](https://github.com/sxn)
[π»](https://github.com/kentcdodds/p-s/commits?author=sxn "Code") [β οΈ](https://github.com/kentcdodds/p-s/commits?author=sxn "Tests") [π](https://github.com/kentcdodds/p-s/commits?author=sxn "Documentation") | [
Keith Gunn](https://github.com/gunnx)
[π](https://github.com/kentcdodds/p-s/issues?q=author%3Agunnx "Bug reports") [π»](https://github.com/kentcdodds/p-s/commits?author=gunnx "Code") [β οΈ](https://github.com/kentcdodds/p-s/commits?author=gunnx "Tests") | [
Joe Martella](http://martellaj.github.io)
[π](https://github.com/kentcdodds/p-s/issues?q=author%3Amartellaj "Bug reports") [π»](https://github.com/kentcdodds/p-s/commits?author=martellaj "Code") [β οΈ](https://github.com/kentcdodds/p-s/commits?author=martellaj "Tests") | [
Martin Segado](https://github.com/msegado)
[π](https://github.com/kentcdodds/p-s/commits?author=msegado "Documentation") | [
Bram Borggreve](http://colmena.io/)
[π](https://github.com/kentcdodds/p-s/issues?q=author%3Abeeman "Bug reports") [π»](https://github.com/kentcdodds/p-s/commits?author=beeman "Code") | [
Elijah Manor](http://elijahmanor.com)
[πΉ](#video-elijahmanor "Videos") | [
Ragu Ramaswamy](https://github.com/rrag)
[π»](https://github.com/kentcdodds/p-s/commits?author=rrag "Code") [β οΈ](https://github.com/kentcdodds/p-s/commits?author=rrag "Tests") [π](https://github.com/kentcdodds/p-s/issues?q=author%3Arrag "Bug reports") |
| [
Erik Fox](http://www.erikfox.co/)
[π](https://github.com/kentcdodds/p-s/issues?q=author%3Aerikfox "Bug reports") [π»](https://github.com/kentcdodds/p-s/commits?author=erikfox "Code") [π](https://github.com/kentcdodds/p-s/commits?author=erikfox "Documentation") [β οΈ](https://github.com/kentcdodds/p-s/commits?author=erikfox "Tests") | [
Aditya Pratap Singh](http://blog.adityapsingh.com)
[π](#review-addityasingh "Reviewed Pull Requests") | [
bumbleblym](https://github.com/bumbleblym)
[π»](https://github.com/kentcdodds/p-s/commits?author=bumbleblym "Code") [π](https://github.com/kentcdodds/p-s/commits?author=bumbleblym "Documentation") | [
Islam Attrash](https://twitter.com/IslamAttrash)
[π»](https://github.com/kentcdodds/p-s/commits?author=Attrash-Islam "Code") | [
JasonSooter](https://github.com/JasonSooter)
[π](https://github.com/kentcdodds/p-s/commits?author=JasonSooter "Documentation") | [
Nate Cavanaugh](http://alterform.com)
[π»](https://github.com/kentcdodds/p-s/commits?author=natecavanaugh "Code") | [
Wissam Abirached](https://designingforscale.com)
[π»](https://github.com/kentcdodds/p-s/commits?author=wabirached "Code") [β οΈ](https://github.com/kentcdodds/p-s/commits?author=wabirached "Tests") |
| [
PaweΕ MikoΕajczyk](https://github.com/Miklet)
[π»](https://github.com/kentcdodds/p-s/commits?author=Miklet "Code") [β οΈ](https://github.com/kentcdodds/p-s/commits?author=Miklet "Tests") | [
Kyle Welch](http://www.krwelch.com)
[π»](https://github.com/kentcdodds/p-s/commits?author=kwelch "Code") [β οΈ](https://github.com/kentcdodds/p-s/commits?author=kwelch "Tests") | [
Lufty Wiranda](http://instagram.com/luftywiranda13)
[π»](https://github.com/kentcdodds/p-s/commits?author=luftywiranda13 "Code") | [
Bhargav Ponnapalli](http://imbhargav5.com)
[π»](https://github.com/kentcdodds/p-s/commits?author=imbhargav5 "Code") | [
falieson](https://github.com/Falieson)
[π](https://github.com/kentcdodds/p-s/commits?author=Falieson "Documentation") [π§](#tool-Falieson "Tools") | [
Suhas Karanth](https://github.com/sudo-suhas)
[π](https://github.com/kentcdodds/p-s/issues?q=author%3Asudo-suhas "Bug reports") [π»](https://github.com/kentcdodds/p-s/commits?author=sudo-suhas "Code") | [
Eric Skram](http://www.ericskram.com)
[π](https://github.com/kentcdodds/p-s/commits?author=Vpr99 "Documentation") |
-| [
Kether Saturnius](http://www.k3th3r.com)
[π»](https://github.com/kentcdodds/p-s/commits?author=iamkether "Code") [π](https://github.com/kentcdodds/p-s/commits?author=iamkether "Documentation") | [
Sviatoslav](https://github.com/SleepWalker)
[π](https://github.com/kentcdodds/p-s/issues?q=author%3ASleepWalker "Bug reports") [π»](https://github.com/kentcdodds/p-s/commits?author=SleepWalker "Code") | [
Wei Wang](https://github.com/onlywei)
[π»](https://github.com/kentcdodds/p-s/commits?author=onlywei "Code") | [
Sami Jaber](http://twitter.com/samjabz)
[π](https://github.com/kentcdodds/p-s/issues?q=author%3Asamijaber "Bug reports") [π»](https://github.com/kentcdodds/p-s/commits?author=samijaber "Code") | [
Florian LΓΆchle](https://github.com/schottilol)
[π»](https://github.com/kentcdodds/p-s/commits?author=schottilol "Code") |
+| [
Kether Saturnius](http://www.k3th3r.com)
[π»](https://github.com/kentcdodds/p-s/commits?author=iamkether "Code") [π](https://github.com/kentcdodds/p-s/commits?author=iamkether "Documentation") | [
Sviatoslav](https://github.com/SleepWalker)
[π](https://github.com/kentcdodds/p-s/issues?q=author%3ASleepWalker "Bug reports") [π»](https://github.com/kentcdodds/p-s/commits?author=SleepWalker "Code") | [
Wei Wang](https://github.com/onlywei)
[π»](https://github.com/kentcdodds/p-s/commits?author=onlywei "Code") | [
Sami Jaber](http://twitter.com/samjabz)
[π](https://github.com/kentcdodds/p-s/issues?q=author%3Asamijaber "Bug reports") [π»](https://github.com/kentcdodds/p-s/commits?author=samijaber "Code") | [
Florian LΓΆchle](https://github.com/schottilol)
[π»](https://github.com/kentcdodds/p-s/commits?author=schottilol "Code") | [
Kevin J](https://github.com/kevjin)
[π»](https://github.com/kentcdodds/p-s/commits?author=kevjin "Code") |
This project follows the [all-contributors][all-contributors] specification.
diff --git a/cli-test/__tests__/__snapshots__/cli.js.snap b/cli-test/__tests__/__snapshots__/cli.js.snap
index 1faf1e6..281a8e5 100644
--- a/cli-test/__tests__/__snapshots__/cli.js.snap
+++ b/cli-test/__tests__/__snapshots__/cli.js.snap
@@ -29,10 +29,10 @@ log
}
`;
-exports[`with --silent 1`] = `
+exports[`with silent option set true 1`] = `
Object {
"stderr": "",
- "stdout": "test script
+ "stdout": "silent
",
}
`;
diff --git a/cli-test/__tests__/cli.js b/cli-test/__tests__/cli.js
index c3c548e..3c89aa2 100644
--- a/cli-test/__tests__/cli.js
+++ b/cli-test/__tests__/cli.js
@@ -9,7 +9,8 @@ test('with config with default script', () =>
test('with a missing config', () =>
snapshot('-c ./something-that-does-not-exist.js'))
-test('with --silent', () => snapshot('test --silent'))
+test('with silent option set true', () =>
+ snapshot('-c ./package-script-silent.js'))
test('with --require', () =>
snapshot('--config ./es6-package-scripts.js --require babel-register log'))
diff --git a/cli-test/__tests__/fixtures/package-script-silent.js b/cli-test/__tests__/fixtures/package-script-silent.js
new file mode 100644
index 0000000..a4f88ee
--- /dev/null
+++ b/cli-test/__tests__/fixtures/package-script-silent.js
@@ -0,0 +1,8 @@
+module.exports = {
+ scripts: {
+ default: 'echo "silent"',
+ },
+ options: {
+ silent: true,
+ }
+}
diff --git a/src/bin/nps.js b/src/bin/nps.js
index 4647a3d..ff2615b 100755
--- a/src/bin/nps.js
+++ b/src/bin/nps.js
@@ -12,11 +12,14 @@ if (argv && psConfig) {
runPackageScript({
scriptConfig: psConfig.scripts,
scripts: argv._,
- options: merge(psConfig.options, {
- silent: argv.silent,
- logLevel: argv.logLevel,
- scripts: argv.scripts,
- }),
+ options: merge(
+ {
+ silent: argv.silent,
+ logLevel: argv.logLevel,
+ scripts: argv.scripts,
+ },
+ psConfig.options,
+ ),
}).then(
() => {
// make this explicit
@@ -25,11 +28,16 @@ if (argv && psConfig) {
process.exitCode = 0
},
error => {
- const logLevel = getLogLevel({
- silent: argv.silent,
- logLevel: argv.logLevel,
- scripts: argv.scripts,
- })
+ const logLevel = getLogLevel(
+ merge(
+ {
+ silent: argv.silent,
+ logLevel: argv.logLevel,
+ scripts: argv.scripts,
+ },
+ psConfig.options,
+ ),
+ )
const log = getLogger(logLevel)
log.error(error)
process.exitCode = error.code || FAIL_CODE