-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
executable file
·35 lines (31 loc) · 1013 Bytes
/
gulpfile.js
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
var gulp = require('gulp');
var less = require('gulp-sass');
var path = require('path');
var shell = require('gulp-shell');
var lessPath = './src/distributed/webclient/sass/**/*.sass';
var goPath = 'src/distributed/**/*.go';
gulp.task('less', function () {
return gulp.src('./src/distributed/webclient/sass/app.sass')
.pipe(less({
paths: [ path.join(__dirname, 'sass', 'includes') ]
}))
.pipe(gulp.dest('./src/distributed/web/res/css'));
});
gulp.task('compilepkg', function() {
return gulp.src(goPath, {read: false})
.pipe(shell(['go install <%= stripPath(file.path) %>'],
{
templateData: {
stripPath: function(filePath) {
var subPath = filePath.substring(process.cwd().length + 5);
var pkg = subPath.substring(0, subPath.lastIndexOf(path.sep));
return pkg;
}
}
})
);
});
gulp.task('watch', function() {
gulp.watch(lessPath, ['less']);
gulp.watch(goPath, ['compilepkg']);
});