From 08e79190943bd969b904bc618c65a43b7d22e36d Mon Sep 17 00:00:00 2001 From: Filipe Silva Date: Tue, 27 Sep 2016 11:16:17 +0100 Subject: [PATCH] fix(gulp): fix build and run task defaults (#2484) --- gulpfile.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 8bad101b31..ac3ee61bac 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -295,14 +295,16 @@ function runE2eTsTests(appDir, outputFile) { try { var exampleConfig = fs.readJsonSync(`${appDir}/${_exampleConfigFilename}`); } catch (e) { - exampleConfig = { - build: 'tsc', - run: 'http-server:e2e' - }; + exampleConfig = {}; } + + var config = { + build: exampleConfig.build || 'tsc', + run: exampleConfig.run || 'http-server:e2e' + }; - var appBuildSpawnInfo = spawnExt('npm', ['run', exampleConfig.build], { cwd: appDir }); - var appRunSpawnInfo = spawnExt('npm', ['run', exampleConfig.run, '--', '-s'], { cwd: appDir }); + var appBuildSpawnInfo = spawnExt('npm', ['run', config.build], { cwd: appDir }); + var appRunSpawnInfo = spawnExt('npm', ['run', config.run, '--', '-s'], { cwd: appDir }); return runProtractor(appBuildSpawnInfo.promise, appDir, appRunSpawnInfo, outputFile); }