Skip to content

Commit

Permalink
process: use defaults when spawning a process
Browse files Browse the repository at this point in the history
While the typings allow for undefined values, the behavior is actually
nasty: If you leave `args` undefined, then `options` are ignored. This
could lead to stdio pipes not being set correctly.

Signed-off-by: Paul Maréchal <paul.marechal@ericsson.com>
  • Loading branch information
paul-marechal committed Nov 18, 2019
1 parent ebe0580 commit 1e27c2b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/process/src/node/raw-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ export class RawProcess extends Process {
if (this.isForkOptions(options)) {
this.process = fork(
options.modulePath,
options.args,
options.options);
options.args || [],
options.options || {});
} else {
this.process = spawn(
options.command,
options.args,
options.options);
options.args || [],
options.options || {});
}

this.process.on('error', (error: NodeJS.ErrnoException) => {
Expand Down

0 comments on commit 1e27c2b

Please sign in to comment.