diff --git a/modules/admin.js b/modules/admin.js index 70be12b..6395fb5 100644 --- a/modules/admin.js +++ b/modules/admin.js @@ -1,4 +1,6 @@ var fs = require('fs'); +var sys = require('sys') +var exec = require('child_process').exec; var adminCommands = function(dbot) { var dbot = dbot; @@ -17,6 +19,15 @@ var adminCommands = function(dbot) { dbot.instance.part(params[1]); }, + // Do a git pull and reload + 'greload': function(data, params) { + var child; + + child = exec("cd ../ && git pull", function (error, stdout, stderr) { + commands.reload(data, params); + }.bind(this)); + }, + 'reload': function(data, params) { dbot.db = JSON.parse(fs.readFileSync('db.json', 'utf-8')); dbot.reloadModules();