redo dry-run commit

This commit is contained in:
Tim Lancina
2015-10-09 10:02:34 -05:00
parent ff2fa2b22d
commit 3f368ff356

View File

@ -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
if (!dryRun) {
exec('cd dist && npm publish', function (err, stdout, stderr) { exec('cd dist && npm publish', function (err, stdout, stderr) {
console.log(stdout); console.log(stdout);
console.error(stderr); console.error(stderr);
done(); done();
}); });
} }
}
) )
}) })