From 8435eded3b9f1a69b610f115e031089237d57ebb Mon Sep 17 00:00:00 2001 From: Addison <152139745+addison-adler@users.noreply.github.com> Date: Sun, 22 Dec 2024 06:50:57 -0500 Subject: [PATCH 1/3] Fix EINVAL crash --- src/util.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util.ts b/src/util.ts index bc898a7..2067b8f 100644 --- a/src/util.ts +++ b/src/util.ts @@ -24,7 +24,8 @@ export class Util { return new Promise((resolve, reject) => { const child = childProcess.spawn(command, args ?? [], { ...(options ?? {}), - stdio: 'inherit' + stdio: 'inherit', + shell: true }); child.addListener('error', reject); child.addListener('exit', resolve); From 9a6563a5a44412b32aee06c71539bae37994b9bf Mon Sep 17 00:00:00 2001 From: Addison <152139745+addison-adler@users.noreply.github.com> Date: Sun, 22 Dec 2024 07:08:48 -0500 Subject: [PATCH 2/3] Set windowsHide: true to hide child process terminal windows --- src/util.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util.ts b/src/util.ts index 2067b8f..1551063 100644 --- a/src/util.ts +++ b/src/util.ts @@ -25,7 +25,8 @@ export class Util { const child = childProcess.spawn(command, args ?? [], { ...(options ?? {}), stdio: 'inherit', - shell: true + shell: true, + windowsHide: true }); child.addListener('error', reject); child.addListener('exit', resolve); From d28cd054776f509c2996ed0937dbc23b8f89b802 Mon Sep 17 00:00:00 2001 From: Addison <152139745+addison-adler@users.noreply.github.com> Date: Sun, 22 Dec 2024 07:10:59 -0500 Subject: [PATCH 3/3] Update spawnAsync Unit Test --- src/util.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.spec.ts b/src/util.spec.ts index 1fe481e..235ef28 100644 --- a/src/util.spec.ts +++ b/src/util.spec.ts @@ -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 } ]); }); });