-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathgulpfile.js
More file actions
36 lines (33 loc) · 781 Bytes
/
gulpfile.js
File metadata and controls
36 lines (33 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var gulp = require('gulp');
var bower = require('gulp-bower');
var git = require('gulp-git');
var spawn = require('child_process').spawn;
// Bower install.
gulp.task('bower', function() {
return bower();
});
// Publish a new release to npm.
gulp.task('publish', ['build'], function(done) {
git.status({
// Use short format.
args: '-s'
},
function (err, stdout) {
if (err) {
throw err;
}
if (!stdout) {
// We have a clean working directory, proceed.
spawn('npm', ['publish'], {
stdio: 'inherit'
}).on('close', done);
}
else {
// Working directory not clean, abort.
console.log('Working directory not clean, aborting...');
done();
}
});
});
// Build Choko.
gulp.task('build', ['bower']);