chore(scripts): update build

This commit is contained in:
Adam Bradley
2017-05-02 12:53:32 -05:00
parent 193eafe1e9
commit 94e54eed98
2 changed files with 14 additions and 8 deletions

View File

@ -1,4 +1,4 @@
import { SRC_ROOT, DIST_BUILD_ROOT, PROJECT_ROOT } from '../constants';
import { PROJECT_ROOT } from '../constants';
import { task } from 'gulp';
import { accessSync } from 'fs';
import { join } from 'path';
@ -13,16 +13,18 @@ task('core.watch', (done) => {
});
function buildAngularBinding(skipBuildingCore: boolean, done: Function) {
function buildAngularBinding(isDevAndWatch: boolean, done: Function) {
let hasRunDone = false;
const cwd = join(PROJECT_ROOT, '../ionic-core');
const args = [
'run',
'build.angular',
SRC_ROOT,
DIST_BUILD_ROOT,
skipBuildingCore ? 'skip-core' : 'do-not-skip-core'
'build.angular'
];
if (isDevAndWatch) {
args.push('--', 'dev', 'watch');
}
try {
accessSync(cwd);
} catch (e) {
@ -35,6 +37,10 @@ function buildAngularBinding(skipBuildingCore: boolean, done: Function) {
ls.stdout.on('data', (data) => {
console.log(data.toString().trim());
if (!hasRunDone && data.toString().trim().indexOf('compile, done') > -1) {
hasRunDone = true;
done();
}
});
ls.stderr.on('data', (data) => {