+gitpull
This commit is contained in:
parent
d250f32e7f
commit
bef5cfcbde
3
bot.js
3
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,
|
||||
|
|
17
src/trigger/gitpull.js
Normal file
17
src/trigger/gitpull.js
Normal file
|
@ -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'
|
||||
});
|
||||
};
|
Loading…
Reference in New Issue
Block a user