forked from qdequippe/friendsofphp-org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
26 lines (22 loc) · 882 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
// install: npm install
// run: gulp
var gulp = require('gulp');
var watch = require('gulp-watch');
var exec = require('child_process').exec;
gulp.task('default', function () {
// Generate current version
exec('vendor/bin/statie generate source', function (err, stdout, stderr) {
console.log(stdout);
console.error(stderr);
});
// Run local server, open localhost:8000 in your browser
exec('php -S localhost:8000 -t output');
// For the second arg see: https://github.com/floatdrop/gulp-watch/issues/242#issuecomment-230209702
return watch(['source/**/*', '!**/*___jb_tmp___'], { ignoreInitial: false })
.on('change', function() {
exec('vendor/bin/statie generate source', function (err, stdout, stderr) {
console.log(stdout);
console.error(stderr);
});
});
});