mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 17:35:34 +00:00
chore(update) move str constant up
This commit is contained in:
parent
a140d5a73c
commit
a00524819e
1 changed files with 64 additions and 64 deletions
|
|
@ -1,64 +1,64 @@
|
|||
/* module update cloud commander */
|
||||
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
if(!global.cloudcmd)
|
||||
return console.log(
|
||||
'# update.js' + '\n' +
|
||||
'# -----------' + '\n' +
|
||||
'# Module is part of Cloud Commander,' + '\n' +
|
||||
'# used for work update thru git.' + '\n' +
|
||||
'# If you wont to see at work install git' + '\n' +
|
||||
'# http://coderaiser.github.com/cloudcmd' + '\n');
|
||||
|
||||
var main = global.cloudcmd.main,
|
||||
mainpackage = main.mainpackage,
|
||||
exec = main.child_process.exec,
|
||||
Util = main.util,
|
||||
DIR = main.DIR;
|
||||
|
||||
exports.get = function(){
|
||||
var lPull = function(){
|
||||
exec('git pull', pull);
|
||||
};
|
||||
|
||||
if( process.cwd === DIR )
|
||||
lPull();
|
||||
else
|
||||
exec('cd ' + DIR, lPull);
|
||||
};
|
||||
|
||||
/**
|
||||
* function pulls cloud cmd content from repo
|
||||
* @param pError
|
||||
* @param pStdout
|
||||
* @param pStderr
|
||||
*/
|
||||
function pull(pError, pStdout, pStderr){
|
||||
var lExec;
|
||||
|
||||
if(!pError){
|
||||
pStderr = '';
|
||||
if(pStdout !== 'Already up-to-date.\n'){
|
||||
pStdout = 'Cloud Commander updated. Restart to use new version.';
|
||||
}
|
||||
else pStdout = 'Cloud Commander is up to date.';
|
||||
|
||||
console.log(DIR);
|
||||
if(mainpackage)
|
||||
pStdout = 'Version ' + mainpackage.version + '\n' + pStdout;
|
||||
|
||||
lExec = {
|
||||
stdout : pStdout,
|
||||
stderr : pStderr || pError
|
||||
};
|
||||
}else
|
||||
lExec = 'install git to get auto updates (works for cloned version)\n' +
|
||||
'git clone http://github.com/coderaiser/cloudcmd';
|
||||
|
||||
|
||||
|
||||
Util.log(lExec);
|
||||
}
|
||||
})();
|
||||
/* module update cloud commander */
|
||||
|
||||
(function(){
|
||||
'use strict';
|
||||
|
||||
if(!global.cloudcmd)
|
||||
return console.log(
|
||||
'# update.js' + '\n' +
|
||||
'# -----------' + '\n' +
|
||||
'# Module is part of Cloud Commander,' + '\n' +
|
||||
'# used for work update thru git.' + '\n' +
|
||||
'# If you wont to see at work install git' + '\n' +
|
||||
'# http://coderaiser.github.com/cloudcmd' + '\n');
|
||||
|
||||
var main = global.cloudcmd.main,
|
||||
mainpackage = main.mainpackage,
|
||||
exec = main.child_process.exec,
|
||||
Util = main.util,
|
||||
DIR = main.DIR;
|
||||
|
||||
exports.get = function(){
|
||||
var lPull = function(){
|
||||
exec('git pull', pull);
|
||||
};
|
||||
|
||||
if( process.cwd === DIR )
|
||||
lPull();
|
||||
else
|
||||
exec('cd ' + DIR, lPull);
|
||||
};
|
||||
|
||||
/**
|
||||
* function pulls cloud cmd content from repo
|
||||
* @param pError
|
||||
* @param pStdout
|
||||
* @param pStderr
|
||||
*/
|
||||
function pull(pError, pStdout, pStderr){
|
||||
var lExec, lStdout = 'Cloud Commander ';
|
||||
|
||||
if(!pError) {
|
||||
pStderr = '';
|
||||
|
||||
if (pStdout !== 'Already up-to-date.\n')
|
||||
lStdout += 'updated. Restart to use new version.';
|
||||
else
|
||||
lStdout += 'is up to date.';
|
||||
|
||||
Util.log(DIR);
|
||||
|
||||
if (mainpackage)
|
||||
lStdout = 'Version ' + mainpackage.version + '\n' + lStdout;
|
||||
|
||||
lExec = {
|
||||
stdout : pStdout,
|
||||
stderr : pStderr || pError
|
||||
};
|
||||
} else
|
||||
lExec = 'install git to get auto updates (works for cloned version)\n' +
|
||||
'git clone http://github.com/coderaiser/cloudcmd';
|
||||
|
||||
Util.log(lExec);
|
||||
}
|
||||
})();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue