2016-09-10 15:34:01 +02:00
|
|
|
var exec = require('child_process').exec;
|
|
|
|
|
2016-09-15 00:05:18 +02:00
|
|
|
module.exports = (lib) => {
|
2016-09-10 15:34:01 +02:00
|
|
|
lib.trigger.add({
|
|
|
|
name: 'gitpull',
|
|
|
|
call: /^\!pull$/,
|
|
|
|
level: 100,
|
|
|
|
active: 1,
|
|
|
|
func: (e) => {
|
|
|
|
exec('cd ../../ & git pull', (error, stdout) => {
|
2016-10-21 02:44:01 +02:00
|
|
|
if(error === null) {
|
2016-10-23 00:10:45 +02:00
|
|
|
if(!lib.debug)
|
|
|
|
e.reply('git pull suxxessfully.');
|
|
|
|
else
|
|
|
|
lib.log(stdout);
|
2016-10-21 02:44:01 +02:00
|
|
|
}
|
2016-09-10 15:34:01 +02:00
|
|
|
});
|
|
|
|
},
|
|
|
|
desc: 'gitpuller'
|
|
|
|
});
|
|
|
|
};
|