Skip to content

Commit cc95bd9

Browse files
committed
cleanup release
1 parent a4303e3 commit cc95bd9

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

tools/gulp/tasks/release.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import child_process = require('child_process');
2-
import fs = require('fs');
3-
import gulp = require('gulp');
1+
import {execSync} from 'child_process';
2+
import {readdirSync, statSync} from 'fs';
3+
import {task} from 'gulp';
44
import gulpRunSequence = require('run-sequence');
55
import path = require('path');
66

77
import {execTask} from '../task_helpers';
88
import {DIST_COMPONENTS_ROOT} from '../constants';
99

1010

11-
gulp.task('build:release', function(done: () => void) {
11+
task('build:release', function(done: () => void) {
1212
// Synchronously run those tasks.
1313
gulpRunSequence(
1414
'clean',
@@ -20,31 +20,32 @@ gulp.task('build:release', function(done: () => void) {
2020

2121

2222
/** Make sure we're logged in. */
23-
gulp.task(':publish:whoami', execTask('npm', ['whoami'], {
23+
task(':publish:whoami', execTask('npm', ['whoami'], {
2424
silent: true,
2525
errMessage: 'You must be logged in to publish.'
2626
}));
27-
gulp.task(':publish:logout', execTask('npm', ['logout']));
28-
gulp.task(':publish', function(done: () => void) {
29-
const exec: any = child_process.execSync;
27+
28+
task(':publish:logout', execTask('npm', ['logout']));
29+
30+
task(':publish', function() {
3031
const currentDir = process.cwd();
3132

32-
fs.readdirSync(DIST_COMPONENTS_ROOT)
33+
readdirSync(DIST_COMPONENTS_ROOT)
3334
.forEach(dirName => {
3435
const componentPath = path.join(DIST_COMPONENTS_ROOT, dirName);
35-
const stat = fs.statSync(componentPath);
36+
const stat = statSync(componentPath);
3637

3738
if (!stat.isDirectory()) {
3839
return;
3940
}
4041

4142
process.chdir(componentPath);
42-
exec('npm publish');
43+
execSync('npm publish');
4344
});
4445
process.chdir(currentDir);
4546
});
4647

47-
gulp.task('publish', function(done: () => void) {
48+
task('publish', function(done: () => void) {
4849
gulpRunSequence(
4950
':publish:whoami',
5051
'build:release',

0 commit comments

Comments
 (0)