From 810bde555b15daf4fe2b2660d2a284b43c475ba8 Mon Sep 17 00:00:00 2001 From: Max Ivanov Date: Thu, 1 Mar 2018 17:55:47 +0300 Subject: [PATCH] fix(ngw-bin): fixing the execution on Windows --- bin/ngw | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/bin/ngw b/bin/ngw index 9d5e696..af651f7 100755 --- a/bin/ngw +++ b/bin/ngw @@ -4,12 +4,13 @@ switch (process.argv[2]) { require('../src/set-up'); break; default: + + const execSync = require('child_process').execSync; + const entryPointPath = require.resolve('../src/index'); + const tsNodePath = require.resolve('../node_modules/ts-node/dist/bin'); + const ngCommandArgs = process.argv.slice(2); + const executionPoint = [tsNodePath, entryPointPath].concat(ngCommandArgs).join(' '); + + execSync(`node ${executionPoint}`, {stdio: 'inherit'}); - var entryPointPath = require.resolve('../src/index'); - var tsNodePath = require.resolve('../node_modules/ts-node/dist/bin'); - - require('child_process').execSync( - [tsNodePath, entryPointPath].concat(process.argv.slice(2)).join(' '), - {stdio: 'inherit'} - ); -} \ No newline at end of file +}