mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(console) onCloudCmd
This commit is contained in:
parent
0e004d80f7
commit
ce53fbc848
1 changed files with 13 additions and 12 deletions
|
|
@ -241,20 +241,19 @@
|
|||
}
|
||||
}
|
||||
|
||||
function onCloudCmd(pCommand, callback) {
|
||||
var lRet;
|
||||
function onCloudCmd(cmd, callback) {
|
||||
var is;
|
||||
|
||||
pCommand = Util.rmStr(pCommand, CLOUDCMD);
|
||||
cmd = Util.rmStr(cmd, CLOUDCMD);
|
||||
is = !equalPart(cmd, ' ');
|
||||
|
||||
if (!equalPart(pCommand, ' ')) {
|
||||
lRet = true;
|
||||
if (is) {
|
||||
Util.exec(callback, HELP);
|
||||
}
|
||||
else {
|
||||
pCommand = Util.rmStr(pCommand, ' ');
|
||||
} else {
|
||||
cmd = Util.rmStr(cmd, ' ');
|
||||
is = update && equalPart(cmd, 'update');
|
||||
|
||||
if (equalPart(pCommand, 'update') && update) {
|
||||
lRet = true;
|
||||
if (is) {
|
||||
update.get();
|
||||
|
||||
Util.exec(callback, {
|
||||
|
|
@ -262,11 +261,13 @@
|
|||
});
|
||||
}
|
||||
|
||||
if (Util.strCmp(pCommand, 'exit'))
|
||||
is = Util.strCmp(cmd, 'exit');
|
||||
|
||||
if (is)
|
||||
process.exit();
|
||||
}
|
||||
|
||||
return lRet;
|
||||
return is;
|
||||
}
|
||||
|
||||
function onCD(cmd, currDir, callback) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue