-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
40 lines (33 loc) · 1.02 KB
/
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
36
37
38
39
40
var gulp = require('gulp');
var pump = require('pump');
var sass = require('gulp-sass');
var exec = require('child_process').exec;
function runCommand(command) {
return function (cb) {
exec(command, function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
}
}
//Running mongo
//https://stackoverflow.com/a/28048696/46810
gulp.task('mongod', runCommand('mongod'));
gulp.task('mongo-plix', runCommand('mongo plix'));
gulp.task('db', ['mongod', 'mongo-plix']);
gulp.task('stop', runCommand('mongo admin --eval "db.shutdownServer();"'));
gulp.task('run', runCommand('nodemon'));
gulp.task('sass', function(){
return gulp.src('scss/**/*.scss')
.pipe(sass())
.pipe(gulp.dest('public/stylesheets'));
});
gulp.task('build', ['sass'], function (cb) {});
gulp.task('watch', ['sass'], function () {
gulp.watch('scss/**/*.scss', ['sass']);
});
gulp.task('stream', ['db', 'build', 'run'], function (cb) {
gulp.watch('scss/**/*.scss', ['build']);
});
gulp.task('default', ['stream']);