mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
refactor(cloudcmd) regExp -> switch
This commit is contained in:
parent
52313ffc46
commit
381dda922d
1 changed files with 6 additions and 4 deletions
|
|
@ -9,12 +9,15 @@
|
|||
argv = process.argv,
|
||||
length = argv.length - 1,
|
||||
argvLast = argv[length],
|
||||
regExp = new RegExp('^test'),
|
||||
isTest = argvLast.match(regExp);
|
||||
isTest;
|
||||
|
||||
if (isTest) {
|
||||
switch (argvLast) {
|
||||
case 'test':
|
||||
Util.log('Cloud Commander testing mode');
|
||||
Util.log('argv: ', argv);
|
||||
|
||||
isTest = true;
|
||||
break;
|
||||
}
|
||||
|
||||
CloudCmd.start({
|
||||
|
|
@ -22,4 +25,3 @@
|
|||
});
|
||||
|
||||
})();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue