mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
add angular version to publish task
This commit is contained in:
19
gulpfile.js
19
gulpfile.js
@ -41,8 +41,8 @@ var tscReporter = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var flagConfig = {
|
var flagConfig = {
|
||||||
string: ['port', 'version'],
|
string: ['port', 'version', 'ngVersion'],
|
||||||
alias: {'p': 'port', 'v': 'version'},
|
alias: {'p': 'port', 'v': 'version', 'a': 'ngVersion'},
|
||||||
default: { port: 8000 }
|
default: { port: 8000 }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -358,12 +358,17 @@ gulp.task('src', function(done){
|
|||||||
})
|
})
|
||||||
|
|
||||||
gulp.task('publish', function(done) {
|
gulp.task('publish', function(done) {
|
||||||
var v = flags.version;
|
var version = flags.version;
|
||||||
if (!v) {
|
var ngVersion = flags.ngVersion;
|
||||||
console.error("\nERR: You need to provide a version or tag.\ngulp publish -v {version}\n");
|
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
|
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");
|
console.error("\n ERR: Just provide version number. Instead of 2.0.0-alpha.10, just enter 10\n");
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -378,7 +383,7 @@ gulp.task('publish', function(done) {
|
|||||||
'transpile.common',
|
'transpile.common',
|
||||||
function() {
|
function() {
|
||||||
var packageJSONTemplate = _.template(fs.readFileSync('scripts/npm/package.json'));
|
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);
|
fs.writeFileSync("dist/package.json", packageJSONContents);
|
||||||
|
|
||||||
// publish to npm
|
// publish to npm
|
||||||
|
@ -7,10 +7,10 @@
|
|||||||
"url": "https://github.com/driftyco/ionic2.git"
|
"url": "https://github.com/driftyco/ionic2.git"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"angular2": "2.0.0-alpha.35",
|
"angular2": "2.0.0-alpha.<%= ngVersion %>",
|
||||||
"reflect-metadata": "0.1.0",
|
"reflect-metadata": "0.1.0",
|
||||||
"rtts_assert": "2.0.0-alpha.35",
|
"rtts_assert": "2.0.0-alpha.<%= ngVersion %>",
|
||||||
"traceur-runtime": "0.0.59",
|
"traceur-runtime": "0.0.59",
|
||||||
"zone.js": "0.5.2"
|
"zone.js": "0.5.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user