forked from GitHub/dbot
greload command to git pull then reload
This commit is contained in:
parent
c7fcb9fe18
commit
d4320bbde7
@ -1,4 +1,6 @@
|
|||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
|
var sys = require('sys')
|
||||||
|
var exec = require('child_process').exec;
|
||||||
|
|
||||||
var adminCommands = function(dbot) {
|
var adminCommands = function(dbot) {
|
||||||
var dbot = dbot;
|
var dbot = dbot;
|
||||||
@ -17,6 +19,15 @@ var adminCommands = function(dbot) {
|
|||||||
dbot.instance.part(params[1]);
|
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) {
|
'reload': function(data, params) {
|
||||||
dbot.db = JSON.parse(fs.readFileSync('db.json', 'utf-8'));
|
dbot.db = JSON.parse(fs.readFileSync('db.json', 'utf-8'));
|
||||||
dbot.reloadModules();
|
dbot.reloadModules();
|
||||||
|
Loading…
Reference in New Issue
Block a user