Skip to content

Commit 15cae8a

Browse files
hanslfilipesilva
authored andcommitted
build: fix deploy script condition (take 11)
1 parent 3d40804 commit 15cae8a

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

scripts/git-builds.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@
55
const spawnSync = require( 'child_process').spawnSync;
66
const fs = require('fs');
77
const temp = require('temp');
8-
const { blue, green, red, gray, yellow } = require('chalk');
8+
const { blue, green, gray } = require('chalk');
99

1010
const path = require('path');
1111
const glob = require('glob');
12-
const cli = 'https://github.com/angular/angular-cli.git';
1312
const cliBuilds = 'https://github.com/angular/cli-builds.git';
1413
const ngToolsWebpackBuilds = 'https://github.com/angular/ngtools-webpack-builds.git';
1514

1615

1716
class Executor {
18-
constructor(cwd) { this._cwd = cwd; }
17+
constructor(cwd) {
18+
this._cwd = cwd;
19+
}
1920

2021
execute(command, ...args) {
2122
args = args.filter(x => x !== undefined);
@@ -32,9 +33,15 @@ class Executor {
3233
}
3334
}
3435

35-
git(...args) { return this.execute('git', ...args); }
36-
npm(...args) { return this.execute('npm', ...args); }
37-
rm(...args) { return this.execute('rm', ...args); }
36+
git(...args) {
37+
return this.execute('git', ...args);
38+
}
39+
npm(...args) {
40+
return this.execute('npm', ...args);
41+
}
42+
rm(...args) {
43+
return this.execute('rm', ...args);
44+
}
3845

3946
glob(pattern, options) {
4047
return glob.sync(pattern, Object.assign({}, options || {}, { cwd: this._cwd }));
@@ -68,7 +75,7 @@ class Executor {
6875

6976
updateVersion(hash) {
7077
const packageJson = JSON.parse(this.read('package.json'));
71-
packageJson.version = `${packageJson.version}-${hash.substr(1, 7)}`;
78+
packageJson.version = `${packageJson.version}-${hash}`;
7279
this.write('package.json', JSON.stringify(packageJson, null, 2));
7380
}
7481

@@ -86,7 +93,7 @@ function main() {
8693
const tempRoot = temp.mkdirSync('angular-cli-builds');
8794
const tempExec = new Executor(tempRoot);
8895

89-
console.log(green(`Cloning builds repos...\n`));
96+
console.log(green('Cloning builds repos...\n'));
9097
tempExec.git('clone', cliBuilds);
9198
tempExec.git('clone', ngToolsWebpackBuilds);
9299

0 commit comments

Comments
 (0)