fix(gulp): fix build and run task defaults (#2484)

This commit is contained in:
Filipe Silva 2016-09-27 11:16:17 +01:00 committed by GitHub
parent 66c630df99
commit 08e7919094
1 changed files with 8 additions and 6 deletions

View File

@ -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 appBuildSpawnInfo = spawnExt('npm', ['run', exampleConfig.build], { cwd: appDir });
var appRunSpawnInfo = spawnExt('npm', ['run', exampleConfig.run, '--', '-s'], { cwd: appDir });
var config = {
build: exampleConfig.build || 'tsc',
run: exampleConfig.run || 'http-server:e2e'
};
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);
}