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

echo $FOO not working (even with -x --use-shell) #336

Open
yatharth opened this issue Dec 26, 2021 · 2 comments
Open

echo $FOO not working (even with -x --use-shell) #336

yatharth opened this issue Dec 26, 2021 · 2 comments

Comments

@yatharth
Copy link

npx env-cmd -x --use-shell 'echo $FOO' doesn’t seem to be working, even with version 10.1.0 which added support for -x.

image

Based on #93 (comment), I would have expected it to work.

@yatharth
Copy link
Author

Even the official example in the README doesn’t work.

Create hello.js with contents:

console.log(process.argv)

Create .env with contents:

FOO=foo

Then run npx env-cmd -x node hello.js.

Result:

image

It appears some attempt at substitution is being made, either by npm or by env-cmd.

@jethrolarson
Copy link

I'm running into this as well. @yatharth you haven't found a workaround, have you?

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

No branches or pull requests

2 participants