mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
redo dry-run commit
This commit is contained in:
16
gulpfile.js
16
gulpfile.js
@ -47,10 +47,12 @@ var tscReporter = {
|
|||||||
|
|
||||||
var flagConfig = {
|
var flagConfig = {
|
||||||
string: ['port', 'version', 'ngVersion', 'animations'],
|
string: ['port', 'version', 'ngVersion', 'animations'],
|
||||||
|
boolean: ['dry-run'],
|
||||||
alias: {'p': 'port', 'v': 'version', 'a': 'ngVersion'},
|
alias: {'p': 'port', 'v': 'version', 'a': 'ngVersion'},
|
||||||
default: { port: 8000 }
|
default: { port: 8000 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
var flags = minimist(process.argv.slice(2), flagConfig);
|
var flags = minimist(process.argv.slice(2), flagConfig);
|
||||||
|
|
||||||
gulp.task('build', function(done) {
|
gulp.task('build', function(done) {
|
||||||
@ -423,6 +425,8 @@ gulp.task('demos:all', ['demos'], function() {
|
|||||||
gulp.task('publish', function(done) {
|
gulp.task('publish', function(done) {
|
||||||
var version = flags.version;
|
var version = flags.version;
|
||||||
var ngVersion = flags.ngVersion;
|
var ngVersion = flags.ngVersion;
|
||||||
|
var dryRun = flags['dry-run'];
|
||||||
|
|
||||||
if (!version || !ngVersion) {
|
if (!version || !ngVersion) {
|
||||||
console.error("\nERR: You need to provide a version for Ionic as well as " +
|
console.error("\nERR: You need to provide a version for Ionic as well as " +
|
||||||
"the version of Angular it depends on.\n\n" +
|
"the version of Angular it depends on.\n\n" +
|
||||||
@ -451,11 +455,13 @@ gulp.task('publish', function(done) {
|
|||||||
fs.writeFileSync('dist/README.md', fs.readFileSync('scripts/npm/README.md'));
|
fs.writeFileSync('dist/README.md', fs.readFileSync('scripts/npm/README.md'));
|
||||||
|
|
||||||
// publish to npm
|
// publish to npm
|
||||||
exec('cd dist && npm publish', function (err, stdout, stderr) {
|
if (!dryRun) {
|
||||||
console.log(stdout);
|
exec('cd dist && npm publish', function (err, stdout, stderr) {
|
||||||
console.error(stderr);
|
console.log(stdout);
|
||||||
done();
|
console.error(stderr);
|
||||||
});
|
done();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user