update gulp script

pull/953/head
tanjinzhou 2019-07-10 18:14:41 +08:00
parent 44d587483c
commit 75dd9f6ceb
5 changed files with 43 additions and 27 deletions

View File

@ -145,14 +145,10 @@ function tag() {
execSync(`git config --global user.name ${process.env.GITHUB_USER_NAME}`); execSync(`git config --global user.name ${process.env.GITHUB_USER_NAME}`);
execSync(`git tag ${version}`); execSync(`git tag ${version}`);
execSync( execSync(
`git push https://${ `git push https://${process.env.GITHUB_TOKEN}@github.com/vueComponent/ant-design-vue.git ${version}:${version}`,
process.env.GITHUB_TOKEN
}@github.com/vueComponent/ant-design-vue.git ${version}:${version}`,
); );
execSync( execSync(
`git push https://${ `git push https://${process.env.GITHUB_TOKEN}@github.com/vueComponent/ant-design-vue.git master:master`,
process.env.GITHUB_TOKEN
}@github.com/vueComponent/ant-design-vue.git master:master`,
); );
console.log('tagged'); console.log('tagged');
} }

View File

@ -110,9 +110,7 @@ export default {
if (settings.centerMode) { if (settings.centerMode) {
if (settings.slidesToScroll > 1 && process.env.NODE_ENV !== 'production') { if (settings.slidesToScroll > 1 && process.env.NODE_ENV !== 'production') {
console.warn( console.warn(
`slidesToScroll should be equal to 1 in centerMode, you are using ${ `slidesToScroll should be equal to 1 in centerMode, you are using ${settings.slidesToScroll}`,
settings.slidesToScroll
}`,
); );
} }
settings.slidesToScroll = 1; settings.slidesToScroll = 1;
@ -121,16 +119,12 @@ export default {
if (settings.fade) { if (settings.fade) {
if (settings.slidesToShow > 1 && process.env.NODE_ENV !== 'production') { if (settings.slidesToShow > 1 && process.env.NODE_ENV !== 'production') {
console.warn( console.warn(
`slidesToShow should be equal to 1 when fade is true, you're using ${ `slidesToShow should be equal to 1 when fade is true, you're using ${settings.slidesToShow}`,
settings.slidesToShow
}`,
); );
} }
if (settings.slidesToScroll > 1 && process.env.NODE_ENV !== 'production') { if (settings.slidesToScroll > 1 && process.env.NODE_ENV !== 'production') {
console.warn( console.warn(
`slidesToScroll should be equal to 1 when fade is true, you're using ${ `slidesToScroll should be equal to 1 when fade is true, you're using ${settings.slidesToScroll}`,
settings.slidesToScroll
}`,
); );
} }
settings.slidesToShow = 1; settings.slidesToShow = 1;

View File

@ -385,9 +385,7 @@ function processEntity(entity, wrapper) {
if (currentEntity) { if (currentEntity) {
warning( warning(
false, false,
`Conflict! value of node '${entity.key}' (${value}) has already used by node '${ `Conflict! value of node '${entity.key}' (${value}) has already used by node '${currentEntity.key}'.`,
currentEntity.key
}'.`,
); );
} }
wrapper.valueEntities[value] = entity; wrapper.valueEntities[value] = entity;

View File

@ -110,12 +110,18 @@ function copyHtml() {
); );
} }
gulp.task('_site', done => { gulp.task(
dist(() => { '_site',
gulp.series(done => {
dist(() => {
copyHtml();
done();
});
}),
);
gulp.task(
'copy-html',
gulp.series(() => {
copyHtml(); copyHtml();
done(); }),
}); );
});
gulp.task('copy-html', () => {
copyHtml();
});

View File

@ -13,6 +13,28 @@ program.on('--help', () => {
program.parse(process.argv); program.parse(process.argv);
function runTask(toRun) {
const metadata = { task: toRun };
// Gulp >= 4.0.0 (doesn't support events)
const taskInstance = gulp.task(toRun);
if (taskInstance === undefined) {
gulp.emit('task_not_found', metadata);
return;
}
const start = process.hrtime();
gulp.emit('task_start', metadata);
try {
taskInstance.apply(gulp);
metadata.hrDuration = process.hrtime(start);
gulp.emit('task_stop', metadata);
gulp.emit('stop');
} catch (err) {
err.hrDuration = process.hrtime(start);
err.task = metadata.task;
gulp.emit('task_err', err);
}
}
const task = program.args[0]; const task = program.args[0];
if (!task) { if (!task) {
@ -22,5 +44,5 @@ if (!task) {
require('./gulpfile'); require('./gulpfile');
gulp.start(task); runTask(task);
} }