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 tag ${version}`);
execSync(
`git push https://${
process.env.GITHUB_TOKEN
}@github.com/vueComponent/ant-design-vue.git ${version}:${version}`,
`git push https://${process.env.GITHUB_TOKEN}@github.com/vueComponent/ant-design-vue.git ${version}:${version}`,
);
execSync(
`git push https://${
process.env.GITHUB_TOKEN
}@github.com/vueComponent/ant-design-vue.git master:master`,
`git push https://${process.env.GITHUB_TOKEN}@github.com/vueComponent/ant-design-vue.git master:master`,
);
console.log('tagged');
}

View File

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

View File

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

View File

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

View File

@ -13,6 +13,28 @@ program.on('--help', () => {
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];
if (!task) {
@ -22,5 +44,5 @@ if (!task) {
require('./gulpfile');
gulp.start(task);
runTask(task);
}