added update module

This commit is contained in:
coderaiser 2012-10-03 04:28:13 -04:00
parent 4cad10f750
commit f1bd5aff50
2 changed files with 33 additions and 2 deletions

View file

@ -1,12 +1,17 @@
"use strict";
var Server = cloudRequire('./server'),
var LIBDIRSERVER = './lib/server/',
Server = cloudRequire('./server'),
path = cloudRequire('path'),
fs = cloudRequire('fs');
fs = cloudRequire('fs'),
update = cloudRequire(LIBDIRSERVER + 'update');
var Config = readConfig();
Config ? Server.start(Config) : Server.start();
update.get();
function readConfig(){

26
lib/server/update.js Normal file
View file

@ -0,0 +1,26 @@
/* module update cloud commander */
var exec = require('child_process').exec;
exports.get = function(){
exec('git pull', pull);
};
/**
* function pulls cloud cmd content from repo
* @param pError
* @param pStdout
* @param pStderr
*/
function pull(pError, pStdout, pStderr){
if (pError !== null) {
console.log('exec error: ' + pError);
}
var lExec = {
stdout : pStdout,
stderr : pStderr || pError
};
console.log(lExec);
}