Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

bash variable format on windows #8574

Closed
idoros opened this issue Jun 15, 2015 · 2 comments
Closed

bash variable format on windows #8574

idoros opened this issue Jun 15, 2015 · 2 comments

Comments

@idoros
Copy link

idoros commented Jun 15, 2015

When running npm script (npm run * / npm test), npm variables (npm_config_*) and env variables are provided to the process. If you write the code directly in project.json then you have no direct way of configuring the variable format (bash / cmd):

mocha --reporter $npm_config_reporter ./dist/test
mocha --reporter %npm_config_reporter% ./dist/test

Because of missing/minimal documentation on the subject, it seems that the $npm_config_* variable is supported by npm itself and that it will work on both platforms... but its not. It would have been nice to have some unified variable substitution format, or that npm will automatically translate bash variables to cmd variables (at list the basic usage).

I'm not sure if this should be automatically managed or left for the developer to configure, but I couldn't find any information in the npm documentation or issues and I hope the message will help anyone who encounter this issue.

@kwonoj
Copy link

kwonoj commented Oct 17, 2015

👍 I'm also encountered this issue and would like to have way to access variable on different platform with unified way.

@npm-robot
Copy link

We're closing this support issue as it has gone three days without activity. The npm CLI team itself does not provide support via this issue tracker, but we are happy when users help each other here. In our experience once a support issue goes dormant it's unlikely to get further activity. If you're still having problems, you may be better served by joining package.community and asking your question there.

For more information about our new issue aging policies and why we've instituted them please see our blog post.

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

No branches or pull requests

4 participants