Skip to content

Instantly share code, notes, and snippets.

@xurenlu
Created August 29, 2016 14:29
Show Gist options
  • Save xurenlu/1722619d52f68ca8aca5aa5c620c7dab to your computer and use it in GitHub Desktop.
Save xurenlu/1722619d52f68ca8aca5aa5c620c7dab to your computer and use it in GitHub Desktop.
var gulp = require("gulp");
var process = require('child_process');
gulp.task('send', function(){
process.exec('/home/x/bin/sendtokaifa',
function (error, stdout, stderr) {
if (error !== null) {
console.log('[send]exec error: ' + error);
}else{
console.log("send finished");
}
}
);
});
// Rerun tasks whenever a file changes.
gulp.task('watch', function() {
gulp.watch("/var/log/php/php-error.log", ["send"]);
});
gulp.task('default', ['watch']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment