mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 11:17:19 +08:00
Revert "add --dry-run flag to publish task"
This reverts commit fb384fbb1a44ad06c6f3cc840ad9cbb21ae0b66d.
This commit is contained in:
41
gulpfile.js
41
gulpfile.js
@ -47,12 +47,10 @@ var tscReporter = {
|
||||
|
||||
var flagConfig = {
|
||||
string: ['port', 'version', 'ngVersion', 'animations'],
|
||||
boolean: ['dry-run'],
|
||||
alias: {'p': 'port', 'v': 'version', 'a': 'ngVersion'},
|
||||
default: { port: 8000 }
|
||||
};
|
||||
|
||||
|
||||
var flags = minimist(process.argv.slice(2), flagConfig);
|
||||
|
||||
gulp.task('build', function(done) {
|
||||
@ -410,42 +408,21 @@ gulp.task('demos', function(){
|
||||
path: path.join(path.dirname(file.path), 'index.html'),
|
||||
}));
|
||||
next(null, file);
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
gulp.task('bundle.demos', ['build.demos'], function(done){
|
||||
var source = require('vinyl-source-stream'),
|
||||
browserify = require('browserify'),
|
||||
glob = require('glob'),
|
||||
es = require('event-stream');
|
||||
|
||||
glob('dist/demos/**/index.js', function(err, files){
|
||||
if (err) done(err);
|
||||
|
||||
var tasks = files.map(function(entry){
|
||||
return browserify({ entries: [entry] })
|
||||
.bundle()
|
||||
.pipe(source(entry))
|
||||
.pipe(gulp.dest('demo.bundle.js'));
|
||||
});
|
||||
es.merge(tasks).on('end', done);
|
||||
})
|
||||
})
|
||||
|
||||
gulp.task('demos', ['bundle.demos']);
|
||||
|
||||
gulp.task('demos:all', ['demos'], function() {
|
||||
return gulp
|
||||
.src('dist/demos/component-docs/**/*')
|
||||
.pipe(gulp.dest('dist/ionic-site/docs/v2/components/demo/'))
|
||||
.pipe(gulp.dest('dist/ionic-site/docs/v2/components/demo/'))
|
||||
});
|
||||
|
||||
gulp.task('publish', function(done) {
|
||||
var version = flags.version;
|
||||
var ngVersion = flags.ngVersion;
|
||||
var dryRun = flags['dry-run'];
|
||||
|
||||
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" +
|
||||
@ -474,13 +451,11 @@ gulp.task('publish', function(done) {
|
||||
fs.writeFileSync('dist/README.md', fs.readFileSync('scripts/npm/README.md'));
|
||||
|
||||
// publish to npm
|
||||
if (!dryRun) {
|
||||
exec('cd dist && npm publish', function (err, stdout, stderr) {
|
||||
console.log(stdout);
|
||||
console.error(stderr);
|
||||
done();
|
||||
});
|
||||
}
|
||||
exec('cd dist && npm publish', function (err, stdout, stderr) {
|
||||
console.log(stdout);
|
||||
console.error(stderr);
|
||||
done();
|
||||
});
|
||||
}
|
||||
)
|
||||
})
|
||||
|
Reference in New Issue
Block a user