mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-24 03:05:41 +00:00
added update module
This commit is contained in:
parent
4cad10f750
commit
f1bd5aff50
2 changed files with 33 additions and 2 deletions
|
|
@ -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
26
lib/server/update.js
Normal 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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue