Skip to content

Commit

Permalink
fix(command-line): make affected and format windows-friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
vsavkin committed Jan 20, 2018
1 parent e12eafd commit 9609fc6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions packages/schematics/src/command-line/affected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function build(apps: string[], rest: string[]) {
if (apps.length > 0) {
console.log(`Building ${apps.join(', ')}`);
apps.forEach(app => {
execSync(`${ngPath()} build ${rest.join(' ')} -a=${app}`, { stdio: [0, 1, 2] });
execSync(`node ${ngPath()} build ${rest.join(' ')} -a=${app}`, { stdio: [0, 1, 2] });
});
} else {
console.log('No apps to build');
Expand All @@ -52,13 +52,14 @@ function e2e(apps: string[], rest: string[]) {
if (apps.length > 0) {
console.log(`Testing ${apps.join(', ')}`);
apps.forEach(app => {
execSync(`${ngPath()} e2e ${rest.join(' ')} -a=${app}`, { stdio: [0, 1, 2] });
execSync(`node ${ngPath()} e2e ${rest.join(' ')} -a=${app}`, { stdio: [0, 1, 2] });
});
} else {
console.log('No apps to test');
}
}

function ngPath() {
return `${path.dirname(path.dirname(path.dirname(resolve.sync('@angular/cli', { basedir: __dirname }))))}/bin/ng`;
const basePath = path.dirname(path.dirname(path.dirname(resolve.sync('@angular/cli', { basedir: __dirname }))));
return path.join(basePath, 'bin', 'ng');
}
3 changes: 2 additions & 1 deletion packages/schematics/src/command-line/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,6 @@ function check(patterns: string[]) {
}

function prettierPath() {
return `${path.dirname(resolve.sync('prettier', { basedir: __dirname }))}/bin-prettier.js`;
const basePath = path.dirname(resolve.sync('prettier', { basedir: __dirname }));
return path.join(basePath, 'bin-prettier.js');
}

0 comments on commit 9609fc6

Please sign in to comment.