From fcb54d90851fe4428d39c5686c3bf506a5795070 Mon Sep 17 00:00:00 2001 From: calebboyd Date: Tue, 26 Sep 2017 23:54:18 -0500 Subject: [PATCH] fix: check error code on build commands --- src/compiler.ts | 8 +++++++- src/steps/cli.ts | 8 +++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/compiler.ts b/src/compiler.ts index d229fa7..1080aa4 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -139,7 +139,13 @@ export class NexeCompiler { stdio: 'ignore' }) .once('error', reject) - .once('close', resolve) + .once('close', (code: number) => { + if (code != 0) { + const error = `${command} ${args.join(' ')} exited with code: ${code}` + reject(new Error(error)) + } + resolve() + }) }) } diff --git a/src/steps/cli.ts b/src/steps/cli.ts index 4c59831..503c06e 100644 --- a/src/steps/cli.ts +++ b/src/steps/cli.ts @@ -41,8 +41,6 @@ export default async function cli(compiler: NexeCompiler, next: () => Promise Promise