From bef5cfcbde0b43fb33e475e7f1c4034130e76d5b Mon Sep 17 00:00:00 2001 From: Flummi Date: Sat, 10 Sep 2016 15:34:01 +0200 Subject: [PATCH] +gitpull --- bot.js | 3 ++- src/trigger/gitpull.js | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/trigger/gitpull.js diff --git a/bot.js b/bot.js index cf601c6..c640ce1 100644 --- a/bot.js +++ b/bot.js @@ -24,10 +24,11 @@ var child = new (forever.Monitor)('./src/main.js', { max: 1, silent: false, args: [], + spinSleepTime: 2000, watch: true, watchIgnoreDotFiles: true, watchIgnorePatterns: [ - '*.log', 'b/*', 't/*' + '*.log', 'b/*', 't/*', 'node_modules/*' ], watchDirectory: __dirname, logFile: log_bot, diff --git a/src/trigger/gitpull.js b/src/trigger/gitpull.js new file mode 100644 index 0000000..21536fb --- /dev/null +++ b/src/trigger/gitpull.js @@ -0,0 +1,17 @@ +var exec = require('child_process').exec; + +module.exports = (bot, lib) => { + lib.trigger.add({ + name: 'gitpull', + call: /^\!pull$/, + level: 100, + active: 1, + func: (e) => { + exec('cd ../../ & git pull', (error, stdout) => { + if(error === null) + e.reply(stdout); + }); + }, + desc: 'gitpuller' + }); +}; \ No newline at end of file