-
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
Add windowsHide option to allow Windows popup from pm2 process file #3466
Conversation
This build is currently failing with the error below, it doesn't pass the "Call PM2 inside PM2" test and I'm not sure why, complains that windowsHide is not a boolean even though I check if it's undefined and set it to to true explicitly. Any tips ? Thanks !
|
The test also runs successfully when I run it from my computer. |
I'm not sure why you want it to be configurable since its by default at true ? |
Because we use it to launch GUI apps so we need to be able to set the setting to false. |
Okay i see, i through that it only hide the console window that spawn before the process, it make sense. |
lib/God/ForkMode.js
Outdated
@@ -94,7 +94,7 @@ module.exports = function ForkMode(God) { | |||
var cspr = spawn(command, args, { | |||
env : pm2_env, | |||
detached : true, | |||
windowsHide: true, | |||
windowsHide: pm2_env.windowsHide, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should do something like
windowsHide: pm2_env.windowsHide || true
Just in case variable is undefined, it's probably why tests are failing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
windowsHide: pm2_env.windowsHide || true
wouldn't work though because false || true
equals true
so it will never be false
(which is the goal).
I did try adding the following however to ensure that windowsHide is not undefined
but it still failed the build test in travis (but succeeded on my machine):
var windowsHide = true;
if (pm2_env.windowsHide != undefined) {
windowsHide = pm2_env.windowsHide
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check undefined is not enough I think, pm2_env.windowsHide can be null, or written as a string "false".
Maybe we should check if variable is a boolean, like so :
typeof(pm2_env.windowHide) === "boolean"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will test that now ! thanks !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix worked but the tests failed for node4 although it doesn't seem related to those changes, is it possible it's a build error ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes sometimes tests failed on node4. I will rerun the job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks !
Thanks guys ! |
Add windowsHide option to allow Windows popup from pm2 process file
Please always submit pull requests on the development branch.