Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit f49b611

Browse files
Foxandxsswardbell
authored andcommitted
chore: be able to install builds versions by tag
closes #2224
1 parent eb76eaa commit f49b611

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

gulpfile.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,10 @@ gulp.task('remove-example-boilerplate', function() {
524524
// either release or current build packages
525525
// Examples:
526526
// gulp install-example-angular --build // use current build packages
527+
// gulp install-example-angular --build=2.0.0-b43f954 // use tagged packages
527528
// gulp install-example-angular // restore release packages
529+
//
530+
// Find the tags here: https://github.com/angular/core-builds/releases
528531
gulp.task('install-example-angular', installExampleAngular);
529532

530533
function installExampleAngular() {
@@ -535,14 +538,28 @@ function installExampleAngular() {
535538
'platform-browser', 'platform-browser-dynamic',
536539
'forms', 'http', 'router', 'upgrade'];
537540

541+
var build = argv.build;
542+
if (build) {
543+
if (typeof build === 'string') {
544+
build = (build[0]==='#' ? '' : '#') + build;
545+
} else {
546+
build = '';
547+
}
548+
} else{
549+
build = 'npm';
550+
}
538551
// Like: "angular/core-builds" or "@angular/core"
539-
sources = libs.map( lib => argv.build ? `angular/${lib}-builds` : `@angular/${lib}`);
552+
sources = libs.map( lib => {
553+
return build === 'npm'
554+
? `@angular/${lib}`
555+
: `git+https://github.com/angular/${lib}-builds${build}`;
556+
});
540557

541558
if (argv.build) { sources.push('@angular/tsc-wrapped');} // tsc-wrapped needed for builds
542559

543560
sources.push('@angular/router-deprecated');
544561

545-
gutil.log(`Installing Angular npm packages from ${argv.build ? 'BUILD' : 'RELEASE'}`);
562+
gutil.log(`Installing Angular packages from ${build === 'npm' ? 'NPM' : 'BUILD ' + build}`);
546563

547564
var spawnInfo = spawnExt('rm', ['-rf', 'node_modules/@angular'], { cwd: EXAMPLES_PATH});
548565
return spawnInfo.promise

0 commit comments

Comments
 (0)