From a00524819ec129c369301df79571873780b045e5 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Sun, 30 Jun 2013 19:17:46 +0000 Subject: [PATCH] chore(update) move str constant up --- lib/server/update.js | 128 +++++++++++++++++++++---------------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/lib/server/update.js b/lib/server/update.js index e0ac486a..16c85263 100644 --- a/lib/server/update.js +++ b/lib/server/update.js @@ -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); + } +})();