From a3a6c0fdfd203eb10fa2acfb90ee2701abb8b5a6 Mon Sep 17 00:00:00 2001 From: Opender Singh Date: Wed, 19 May 2021 23:41:50 +1200 Subject: [PATCH] fail if non zero exit code during build (#3399) --- packages/insomnia-app/scripts/build.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/insomnia-app/scripts/build.ts b/packages/insomnia-app/scripts/build.ts index c24a4eb3c2..df67fd4365 100644 --- a/packages/insomnia-app/scripts/build.ts +++ b/packages/insomnia-app/scripts/build.ts @@ -109,7 +109,7 @@ const buildLicenseList = (relSource: string, relDest: string) => new Promise new Promise(resolve => { +const install = (relDir: string) => new Promise((resolve, reject) => { const prefix = path.resolve(__dirname, relDir); const p = childProcess.spawn('npm', ['install', '--production', '--no-optional'], { @@ -127,7 +127,11 @@ const install = (relDir: string) => new Promise(resolve => { p.on('exit', code => { console.log(`child process exited with code ${code}`); - resolve(); + if (code === 0) { + resolve(); + } else { + reject(new Error('[build] failed to install dependencies')); + } }); });