-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Can't supply command line arguments to script #13
Comments
Not sure we can do that easily for now, as require is used for launching the script. CLI Code : Fork child ProcessContainer.js : ProcessContainer script require : |
I think it would be really easy to parse extra params within single quote chars and enrich process.argv with them. On 19 jun. 2013, at 05:49, Alexandre Strzelewicz notifications@github.com wrote:
|
That's a solution, pull me a request 👍 ! :) |
Not behind comp today nor have time soon, but will do at some point... On 19 jun. 2013, at 12:54, Alexandre Strzelewicz notifications@github.com wrote:
|
A standard unix way of doing such things would be something like that: when anything after "--" parameter is passed to the script (see http://unix.stackexchange.com/questions/11376/what-does-double-dash-mean) PS: I suppose, |
Nice. Learned a thing on my day off ;) On 19 jun. 2013, at 18:43, Alex Kocharin notifications@github.com wrote:
|
Fixed and thanks for the tip Alex ;) |
NOTICE that the arguments you supply will persist until you delete and restart the app:
Above will not work, you should do the following:
However I think it's weird, what if I want to change an argument... |
@xieranmaya Thank you! |
Now with PM2 > 1.1.x this:
works, but doing $ pm2 restart app.js Will still keep the latest arguments (11, 22, 33) |
@Unitech Great improve! |
Is there a way to run two processes with different arguments but the same script with this configuration?
|
Hello. I dont need to keep latest arguments. How can i "nullify" them? |
What is the way to run |
Try:
pm2 start 'script.js -d 1'
and it crashes, showing a module not found error:
Error: Cannot find module '......./device-simulation.js -d 1'
The text was updated successfully, but these errors were encountered: