mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
fix(terminal-run) resolve before close
This commit is contained in:
parent
b374437fb6
commit
c212acd90b
2 changed files with 21 additions and 18 deletions
|
|
@ -54,7 +54,7 @@ module.exports = function loadModule(params) {
|
|||
if (e)
|
||||
return console.error(e);
|
||||
|
||||
a.show(...args);
|
||||
await a.show(...args);
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,26 @@ module.exports.init = async () => {
|
|||
await loadAll();
|
||||
};
|
||||
|
||||
module.exports.show = show;
|
||||
module.exports.show = promisify((options = {}, fn) => {
|
||||
if (!Loaded)
|
||||
return;
|
||||
|
||||
if (!config('terminal'))
|
||||
return;
|
||||
|
||||
create(options);
|
||||
|
||||
CloudCmd.View.show(Terminal.element, {
|
||||
afterShow: () => {
|
||||
Terminal.focus();
|
||||
},
|
||||
afterClose: (/* exec.series args */) => {
|
||||
fn();
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
module.exports.hide = hide;
|
||||
|
||||
function hide () {
|
||||
|
|
@ -128,19 +147,3 @@ function authCheck(spawn) {
|
|||
});
|
||||
}
|
||||
|
||||
async function show(options = {}) {
|
||||
if (!Loaded)
|
||||
return;
|
||||
|
||||
if (!config('terminal'))
|
||||
return;
|
||||
|
||||
await create(options);
|
||||
|
||||
CloudCmd.View.show(Terminal.element, {
|
||||
afterShow: () => {
|
||||
Terminal.focus();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue