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

Issue with assigning variables #45

Closed
davesnx opened this issue Feb 16, 2016 · 5 comments
Closed

Issue with assigning variables #45

davesnx opened this issue Feb 16, 2016 · 5 comments

Comments

@davesnx
Copy link

davesnx commented Feb 16, 2016

parallelshell "echo 1" "ENV=3"

Hello,
You can't declare variables, I guess that is because isn't a process (?). I'm not sure if it's an issue or not.
The use case for that is you want to define some env variables at the same time of running a process.
i.e.

NODE_ENV=dev node server.js

Edit: Reading the code I'm figuring out what's going on, the child-process spawn is throwing an error.

@paulpflug
Copy link
Collaborator

I think, this should work:

parallelshell "ENV=3 echo 1"

@davesnx
Copy link
Author

davesnx commented Feb 16, 2016

@paulpflug isn't working, it's the same error.
The spawn is reading ENV=3 as a command, If I have time I will open a PR with the fix

@paulpflug
Copy link
Collaborator

basically parallelshell does a sh -c "command"
when I call sh -c "TEST=test env", TEST is there but sh -c "TEST=test echo $TEST" doesn't print anything

seems it is a problem of echo, maybe it computes its own env?

@davesnx
Copy link
Author

davesnx commented Feb 21, 2016

I don't think so... when u call sh -c "ENV" shows all the ENV of the system
Also, when u run parallelshell "TEST=test"throws and error of sh
If you run sh -a => Mark variables which are modified or created for export.

@paulpflug
Copy link
Collaborator

"TEST=test" should only work for the following command if you want to
export to ENV then you have to use "export", but parallelshell doesn't
support ENV exchange between different commands.

Am 21. Februar 2016 1:48:50 nachm. schrieb David Sancho
notifications@github.com:

I don't think so... when u call sh -c "ENV" shows all the ENV of the system
Also, when u run parallelshell "TEST=test"throws and error of sh


Reply to this email directly or view it on GitHub:
#45 (comment)

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