var exec = require('child_process').exec;

module.exports = (lib) => {
  lib.trigger.add({
    name: 'gitpull',
    call: /^\!pull$/,
    level: 100,
    active: 0,
    func: (e) => {
      exec('cd ../../ & git pull', (error, stdout) => {
        if(error === null) {
          if(!lib.debug)
            e.reply('git pull suxxessfully.');
          else
            lib.log(stdout);
        }
      });
    },
    desc: 'gitpuller'
  });
};