mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
Revert "add --dry-run flag to publish task"
This reverts commit fb384fbb1a44ad06c6f3cc840ad9cbb21ae0b66d.
This commit is contained in:
39
gulpfile.js
39
gulpfile.js
@ -47,12 +47,10 @@ 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) {
|
||||||
@ -410,31 +408,12 @@ gulp.task('demos', function(){
|
|||||||
path: path.join(path.dirname(file.path), 'index.html'),
|
path: path.join(path.dirname(file.path), 'index.html'),
|
||||||
}));
|
}));
|
||||||
next(null, file);
|
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() {
|
gulp.task('demos:all', ['demos'], function() {
|
||||||
return gulp
|
return gulp
|
||||||
.src('dist/demos/component-docs/**/*')
|
.src('dist/demos/component-docs/**/*')
|
||||||
@ -444,8 +423,6 @@ 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" +
|
||||||
@ -474,13 +451,11 @@ 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();
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user