Skip to content

Commit

Permalink
Fix EINVAL crash (#82)
Browse files Browse the repository at this point in the history
* Fix EINVAL crash

* Set windowsHide: true to hide child process terminal windows

* Update spawnAsync Unit Test

---------

Co-authored-by: Bronley Plumb <bronley@gmail.com>
  • Loading branch information
addison-adler and TwitchBronBron authored Dec 23, 2024
1 parent 41ae628 commit 8863439
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/util.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('Util', () => {
});
await util.spawnAsync('noop');
expect(stub.getCalls()[0].args).to.eql([
'noop', [], { stdio: 'inherit' }
'noop', [], { stdio: 'inherit', shell: true, windowsHide: true }
]);
});
});
Expand Down
4 changes: 3 additions & 1 deletion src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export class Util {
return new Promise((resolve, reject) => {
const child = childProcess.spawn(command, args ?? [], {
...(options ?? {}),
stdio: 'inherit'
stdio: 'inherit',
shell: true,
windowsHide: true
});
child.addListener('error', reject);
child.addListener('exit', resolve);
Expand Down

0 comments on commit 8863439

Please sign in to comment.