mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(package) try-catch v2.0.0
This commit is contained in:
parent
7acf191f61
commit
73c7f8713b
5 changed files with 12 additions and 18 deletions
|
|
@ -14,17 +14,15 @@ function getTerminal(term, arg) {
|
|||
if (!term)
|
||||
return noop;
|
||||
|
||||
let result;
|
||||
|
||||
const e = tryCatch(() => {
|
||||
result = require(config('terminalPath'));
|
||||
});
|
||||
const result = tryCatch(require, config('terminalPath'));
|
||||
const e = result[0];
|
||||
const terminalModule = result[1];
|
||||
|
||||
if (!e && !arg)
|
||||
return result;
|
||||
return terminalModule;
|
||||
|
||||
if (!e)
|
||||
return result(arg);
|
||||
return terminalModule(arg);
|
||||
|
||||
config('terminal', false);
|
||||
console.log(`cloudcmd --terminal: ${e.message}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue