mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(config-manager) add (#208)
This commit is contained in:
parent
fe9723fa15
commit
f9c659612a
33 changed files with 446 additions and 477 deletions
|
|
@ -1,17 +1,15 @@
|
|||
'use strict';
|
||||
|
||||
const tryCatch = require('try-catch');
|
||||
const config = require('./config');
|
||||
|
||||
const noop = (req, res, next) => {
|
||||
next && next();
|
||||
};
|
||||
|
||||
noop.listen = noop;
|
||||
|
||||
module.exports = (arg) => getTerminal(config('terminal'), arg);
|
||||
|
||||
function getTerminal(term, arg) {
|
||||
if (!term)
|
||||
module.exports = (config, arg) => {
|
||||
if (!config('terminal'))
|
||||
return noop;
|
||||
|
||||
const [e, terminalModule] = tryCatch(require, config('terminalPath'));
|
||||
|
|
@ -26,5 +24,5 @@ function getTerminal(term, arg) {
|
|||
console.log(`cloudcmd --terminal: ${e.message}`);
|
||||
|
||||
return noop;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue