Initial commit
parent
f45eb6dfd4
commit
901176e7cf
@ -0,0 +1,73 @@
|
||||
var gulp = require("gulp");
|
||||
var psTree = require("ps-tree");
|
||||
var nodemon = require("gulp-nodemon");
|
||||
var presetES2015 = require("@joepie91/gulp-preset-es2015");
|
||||
|
||||
var source = ["src/**/*.js"];
|
||||
|
||||
/* The following resolves JacksonGariety/gulp-nodemon#33 */
|
||||
process.once("SIGINT", function() {
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
/* The following resolves remy/nodemon#34 */
|
||||
function cleanupChildren(cb) {
|
||||
psTree(process.pid, function(err, children) {
|
||||
children.filter(function(child) {
|
||||
return (child.PPID === process.pid.toString() && child.COMMAND === "node");
|
||||
}).forEach(function(child) {
|
||||
killChildren(children, child.PID);
|
||||
});
|
||||
|
||||
cb();
|
||||
});
|
||||
}
|
||||
|
||||
function killChildren(children, pid) {
|
||||
children.forEach(function(child) {
|
||||
if (child.PPID === pid) {
|
||||
killChildren(children, child.PID);
|
||||
}
|
||||
});
|
||||
|
||||
console.error("Killing child Node.js process:", pid);
|
||||
process.kill(parseInt(pid));
|
||||
}
|
||||
|
||||
process.once("uncaughtException", function(err) {
|
||||
console.log(err.stack || err);
|
||||
|
||||
cleanupChildren(function() {
|
||||
process.exit(1);
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
gulp.task('babel', function() {
|
||||
return gulp.src(source)
|
||||
.pipe(presetES2015({
|
||||
basePath: __dirname
|
||||
}))
|
||||
.pipe(gulp.dest("lib/"));
|
||||
});
|
||||
|
||||
gulp.task("watch", function () {
|
||||
gulp.watch(source, ["babel"]);
|
||||
});
|
||||
|
||||
|
||||
gulp.task("nodemon", ["babel"], function() {
|
||||
return nodemon({
|
||||
script: "lib/index.js",
|
||||
ignore: [
|
||||
"gulpfile.js",
|
||||
"node_modules"
|
||||
]
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task("watch", ["nodemon"], function() {
|
||||
gulp.watch(source, ["babel"])
|
||||
});
|
||||
|
||||
gulp.task('default', ["watch"]);
|
@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "ircbullshit-proxy",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git@git.cryto.net:orgBullshit/ircBullshit-proxy.git"
|
||||
},
|
||||
"author": "",
|
||||
"license": "WTFPL",
|
||||
"devDependencies": {
|
||||
"@joepie91/gulp-preset-es2015": "^1.0.1",
|
||||
"babel-preset-es2015": "^6.9.0",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-nodemon": "^2.1.0",
|
||||
"ps-tree": "^1.1.0"
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
// Application entry point goes here...
|
||||
|
||||
console.log("Hello world!");
|
Loading…
Reference in New Issue