Skip to content

Commit 75dd9f6

Browse files
committed
update gulp script
1 parent 44d5874 commit 75dd9f6

File tree

5 files changed

+43
-27
lines changed

5 files changed

+43
-27
lines changed

antd-tools/gulpfile.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,10 @@ function tag() {
145145
execSync(`git config --global user.name ${process.env.GITHUB_USER_NAME}`);
146146
execSync(`git tag ${version}`);
147147
execSync(
148-
`git push https://${
149-
process.env.GITHUB_TOKEN
150-
}@github.com/vueComponent/ant-design-vue.git ${version}:${version}`,
148+
`git push https://${process.env.GITHUB_TOKEN}@github.com/vueComponent/ant-design-vue.git ${version}:${version}`,
151149
);
152150
execSync(
153-
`git push https://${
154-
process.env.GITHUB_TOKEN
155-
}@github.com/vueComponent/ant-design-vue.git master:master`,
151+
`git push https://${process.env.GITHUB_TOKEN}@github.com/vueComponent/ant-design-vue.git master:master`,
156152
);
157153
console.log('tagged');
158154
}

components/vc-slick/src/slider.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,7 @@ export default {
110110
if (settings.centerMode) {
111111
if (settings.slidesToScroll > 1 && process.env.NODE_ENV !== 'production') {
112112
console.warn(
113-
`slidesToScroll should be equal to 1 in centerMode, you are using ${
114-
settings.slidesToScroll
115-
}`,
113+
`slidesToScroll should be equal to 1 in centerMode, you are using ${settings.slidesToScroll}`,
116114
);
117115
}
118116
settings.slidesToScroll = 1;
@@ -121,16 +119,12 @@ export default {
121119
if (settings.fade) {
122120
if (settings.slidesToShow > 1 && process.env.NODE_ENV !== 'production') {
123121
console.warn(
124-
`slidesToShow should be equal to 1 when fade is true, you're using ${
125-
settings.slidesToShow
126-
}`,
122+
`slidesToShow should be equal to 1 when fade is true, you're using ${settings.slidesToShow}`,
127123
);
128124
}
129125
if (settings.slidesToScroll > 1 && process.env.NODE_ENV !== 'production') {
130126
console.warn(
131-
`slidesToScroll should be equal to 1 when fade is true, you're using ${
132-
settings.slidesToScroll
133-
}`,
127+
`slidesToScroll should be equal to 1 when fade is true, you're using ${settings.slidesToScroll}`,
134128
);
135129
}
136130
settings.slidesToShow = 1;

components/vc-tree-select/src/util.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,7 @@ function processEntity(entity, wrapper) {
385385
if (currentEntity) {
386386
warning(
387387
false,
388-
`Conflict! value of node '${entity.key}' (${value}) has already used by node '${
389-
currentEntity.key
390-
}'.`,
388+
`Conflict! value of node '${entity.key}' (${value}) has already used by node '${currentEntity.key}'.`,
391389
);
392390
}
393391
wrapper.valueEntities[value] = entity;

scripts/gulpfile.js

+14-8
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,18 @@ function copyHtml() {
110110
);
111111
}
112112

113-
gulp.task('_site', done => {
114-
dist(() => {
113+
gulp.task(
114+
'_site',
115+
gulp.series(done => {
116+
dist(() => {
117+
copyHtml();
118+
done();
119+
});
120+
}),
121+
);
122+
gulp.task(
123+
'copy-html',
124+
gulp.series(() => {
115125
copyHtml();
116-
done();
117-
});
118-
});
119-
gulp.task('copy-html', () => {
120-
copyHtml();
121-
});
126+
}),
127+
);

scripts/run.js

+23-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,28 @@ program.on('--help', () => {
1313

1414
program.parse(process.argv);
1515

16+
function runTask(toRun) {
17+
const metadata = { task: toRun };
18+
// Gulp >= 4.0.0 (doesn't support events)
19+
const taskInstance = gulp.task(toRun);
20+
if (taskInstance === undefined) {
21+
gulp.emit('task_not_found', metadata);
22+
return;
23+
}
24+
const start = process.hrtime();
25+
gulp.emit('task_start', metadata);
26+
try {
27+
taskInstance.apply(gulp);
28+
metadata.hrDuration = process.hrtime(start);
29+
gulp.emit('task_stop', metadata);
30+
gulp.emit('stop');
31+
} catch (err) {
32+
err.hrDuration = process.hrtime(start);
33+
err.task = metadata.task;
34+
gulp.emit('task_err', err);
35+
}
36+
}
37+
1638
const task = program.args[0];
1739

1840
if (!task) {
@@ -22,5 +44,5 @@ if (!task) {
2244

2345
require('./gulpfile');
2446

25-
gulp.start(task);
47+
runTask(task);
2648
}

0 commit comments

Comments
 (0)