From 02db50e96dbd549479acc4aea917d5d564ff47dc Mon Sep 17 00:00:00 2001 From: Tim Lancina Date: Sun, 6 Sep 2015 22:11:46 -0500 Subject: [PATCH] add angular version to publish task --- gulpfile.js | 19 ++++++++++++------- scripts/npm/package.json | 6 +++--- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index c028497984..665ae21e68 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -41,8 +41,8 @@ var tscReporter = { }; var flagConfig = { - string: ['port', 'version'], - alias: {'p': 'port', 'v': 'version'}, + string: ['port', 'version', 'ngVersion'], + alias: {'p': 'port', 'v': 'version', 'a': 'ngVersion'}, default: { port: 8000 } }; @@ -358,12 +358,17 @@ gulp.task('src', function(done){ }) gulp.task('publish', function(done) { - var v = flags.version; - if (!v) { - console.error("\nERR: You need to provide a version or tag.\ngulp publish -v {version}\n"); + var version = flags.version; + var ngVersion = flags.ngVersion; + if (!version || !ngVersion) { + console.error("\nERR: You need to provide a version for Ionic as well as " + + "the version of Angular it depends on.\n\n" + + "gulp publish -v {version} -a {ngVersion}\n"); return } - if (v.indexOf("alpha") + v.indexOf("-") > -2) { + if (version.indexOf("alpha") + version.indexOf("-") > -2 || + ngVersion.indexOf("alpha") + ngVersion.indexOf("-") > -2) + { console.error("\n ERR: Just provide version number. Instead of 2.0.0-alpha.10, just enter 10\n"); return } @@ -378,7 +383,7 @@ gulp.task('publish', function(done) { 'transpile.common', function() { var packageJSONTemplate = _.template(fs.readFileSync('scripts/npm/package.json')); - packageJSONContents = packageJSONTemplate({ 'version': v }); + packageJSONContents = packageJSONTemplate({ 'version': version, 'ngVersion': ngVersion }); fs.writeFileSync("dist/package.json", packageJSONContents); // publish to npm diff --git a/scripts/npm/package.json b/scripts/npm/package.json index e60c7951fc..c5b165efd4 100644 --- a/scripts/npm/package.json +++ b/scripts/npm/package.json @@ -7,10 +7,10 @@ "url": "https://github.com/driftyco/ionic2.git" }, "dependencies": { - "angular2": "2.0.0-alpha.35", + "angular2": "2.0.0-alpha.<%= ngVersion %>", "reflect-metadata": "0.1.0", - "rtts_assert": "2.0.0-alpha.35", + "rtts_assert": "2.0.0-alpha.<%= ngVersion %>", "traceur-runtime": "0.0.59", - "zone.js": "0.5.2" + "zone.js": "0.5.4" } }