55const spawnSync = require ( 'child_process' ) . spawnSync ;
66const fs = require ( 'fs' ) ;
77const temp = require ( 'temp' ) ;
8- const { blue, green, red , gray, yellow } = require ( 'chalk' ) ;
8+ const { blue, green, gray } = require ( 'chalk' ) ;
99
1010const path = require ( 'path' ) ;
1111const glob = require ( 'glob' ) ;
12- const cli = 'https://github.com/angular/angular-cli.git' ;
1312const cliBuilds = 'https://github.com/angular/cli-builds.git' ;
1413const ngToolsWebpackBuilds = 'https://github.com/angular/ngtools-webpack-builds.git' ;
1514
1615
1716class 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