You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While investigating #94 I noticed that in some places there is an assumption that shell.exec() is synchronous. In fact, it is not when a callback is provided:
In this case, for example, init() will return immediately since shell.exec() is the last statement in the function. It's not clear whether init() is expected to fully complete its work before returning:
I've no evidence this is a problem right now, but if the caller does expect init to be finished upon returning, then script could conceivably exit before the callback has a chance to run. Either init() should explicitly return a promise, take a callback, or ensure it completes its work before returning.
In this case, assuming we want the latter, simply adding {async:false} should do the trick.
The text was updated successfully, but these errors were encountered:
While investigating #94 I noticed that in some places there is an assumption that shell.exec() is synchronous. In fact, it is not when a callback is provided:
https://github.com/arturadib/shelljs#execcommand--options--callback
In this case, for example, init() will return immediately since shell.exec() is the last statement in the function. It's not clear whether init() is expected to fully complete its work before returning:
https://github.com/linnovate/mean-cli/blob/master/lib/cli.js#L896
I've no evidence this is a problem right now, but if the caller does expect init to be finished upon returning, then script could conceivably exit before the callback has a chance to run. Either init() should explicitly return a promise, take a callback, or ensure it completes its work before returning.
In this case, assuming we want the latter, simply adding {async:false} should do the trick.
The text was updated successfully, but these errors were encountered: