mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 01:17:18 +00:00
added update module
This commit is contained in:
parent
4cad10f750
commit
f1bd5aff50
2 changed files with 33 additions and 2 deletions
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