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

ignoring of config variables overwritten via command line #13

Closed
jmilkiewicz opened this issue Nov 15, 2015 · 11 comments
Closed

ignoring of config variables overwritten via command line #13

jmilkiewicz opened this issue Nov 15, 2015 · 11 comments
Assignees
Labels

Comments

@jmilkiewicz
Copy link

Hi

I bumped into a problem that npm-run-all does not propagate overwritten configuration parameters (via command line) when running tasks.
To be more precise:
when i run a package script from command line and overwrite configuration parameters (via --<project.name>:<configuraton_param_name>=<configuration_param_value> ) than everything is fine, ie. my script command would be run against overwritten parameters.

But if my package script command executes npm-run-all than any of "run-all" tasks are not handed overwritten parameters.
I did create a small test case https://github.com/jmilkiewicz/npm-run-all-bug
which uncovers that issue. The case is based on specifying custom matcher for mocha via configuration parameters.

jmilkiewicz referenced this issue in hoodiehq/hoodie-css Nov 15, 2015
So I did a lot and was doing it all over the place all the times, and I
was very lax about commits. So I’m sorry.

I’ve added documentation for each of the scripts that we have. All of
them do the thing that we expect them to (as far as I know), and we now
have a nice npm run help thing too.
@mysticatea
Copy link
Owner

Thank you for reporting and providing the test case!
I will investigate it today (JST).

@mysticatea mysticatea added the bug label Nov 16, 2015
@mysticatea mysticatea self-assigned this Nov 16, 2015
@mysticatea
Copy link
Owner

OK, I had not noticed this feature.
I will add support this.

Please wait for a few days to release... (I don't have enough time in weekdays)

@mysticatea
Copy link
Owner

I released v1.3.0 now.
I added supporting --:= options. Tests are here.

Please try it!

@jmilkiewicz
Copy link
Author

Hi

So for now it does not work at all :(.
when i updated to 1.3.0 than on running
npm test --npm-run-all-bug:reporter=nyan

i got:

ERROR: test:t: None-Zero Exit(7);
npm ERR! Test failed. See above for more details.

in npm-debug.log one can see more details:

⌘ cat npm-debug.log.c6eddc672a318240c004b7a835d29ae0
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'run-script',
1 verbose cli 'test:t' ]
2 info using npm@2.14.7
3 info using node@v4.2.1
4 verbose run-script [ 'pretest:t', 'test:t', 'posttest:t' ]
5 info pretest:t npm-run-all-bug@1.0.0
6 info test:t npm-run-all-bug@1.0.0
7 verbose unsafe-perm in lifecycle true
8 verbose stack Error: write EIO
8 verbose stack at Object.exports._errnoException (util.js:874:11)
8 verbose stack at exports._exceptionWithHostPort (util.js:897:20)
8 verbose stack at WriteWrap.afterWrite (net.js:763:14)
9 verbose cwd /Users/jmilkiewicz/workspace/npm-run-all-bug
10 error Darwin 14.5.0
11 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run-script" "test:t"
12 error node v4.2.1
13 error npm v2.14.7
14 error code EIO
15 error errno EIO
16 error syscall write
17 error write EIO
18 error If you need help, you may report this error at:
18 error https://github.com/npm/npm/issues
19 verbose exit [ 1, true ]

@mysticatea
Copy link
Owner

I'm sorry.
I fixed the problem, and republished as v1.3.2.
I hope you can use the overwriting feature...

@mysticatea
Copy link
Owner

I believe this feature is working now.
Please feel free to reopen if problems have remained.

@jmilkiewicz
Copy link
Author

Hey
Sorry for a huge delay - we simply had fire in project i am working on. Thx a lot for your effort fixing that issue (and a temporary break it introduce in v 1.3.1).
It is hard to me to say that it still does not work in version 1.3.3. I wish i could provide you with a better test suite ( an automated one) but for now i only have https://github.com/jmilkiewicz/npm-run-all-bug
Please simply clone the repo and run these 3 commands as described in README to find out that it still does not work as expected.

@jmilkiewicz
Copy link
Author

It seems i have no permission to reopen that issue, but definitely it shall be re opened

@mysticatea mysticatea reopened this Dec 5, 2015
@mysticatea
Copy link
Owner

I think that's expected behavior because npm run-script is the same behavior.

diff --git a/package.json b/package.json
index 05d2bd0..bf58b4b 100644
--- a/package.json
+++ b/package.json
@@ -8,8 +8,8 @@
   "main": "index.js",
   "scripts": {
     "test": "npm-run-all test:*",
-    "test-2": "npm-run-all test:t",
-    "test:t": "mocha --reporter  ${npm_package_config_reporter}"
+    "test-2": "npm run test:t",
+    "test:t": "mocha --reporter  %npm_package_config_reporter%"
   },
   "keywords": [],
   "author": "",
C:\Users\t-nagashima.AD\Documents\GitHub\npm-run-all-bug [master +0 ~1 -0]> npm run-script test-2 --npm-run-all-bug:reporter=nyan

> npm-run-all-bug@1.0.0 test-2 C:\Users\t-nagashima.AD\Documents\GitHub\npm-run-all-bug
> npm run test:t


> npm-run-all-bug@1.0.0 test:t C:\Users\t-nagashima.AD\Documents\GitHub\npm-run-all-bug
> mocha --reporter  %npm_package_config_reporter%



  Array
    #indexOf()
      √ should return -1 when the value is not present


  1 passing (9ms)

@mysticatea
Copy link
Owner

Hmm, but the purpose is different between npm run-script and npm-run-all, so to forward the overwritten state might make sense.

@mysticatea
Copy link
Owner

Now, npm-run-all came to transfer overwritten config values to nested calls.
Please try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants