mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
feature(terminal-run) add ability to resolve exit code
This commit is contained in:
parent
a360301759
commit
3a16715e03
2 changed files with 8 additions and 4 deletions
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
const {promisify} = require('es6-promisify');
|
||||
const tryToCatch = require('try-to-catch/legacy');
|
||||
const fullstore = require('fullstore/legacy');
|
||||
|
||||
require('../../css/terminal.css');
|
||||
|
||||
|
|
@ -26,6 +27,8 @@ let Loaded;
|
|||
let Terminal;
|
||||
let Socket;
|
||||
|
||||
const exitCodeStore = fullstore();
|
||||
|
||||
const loadAll = async () => {
|
||||
const {prefix} = CloudCmd;
|
||||
|
||||
|
|
@ -67,12 +70,11 @@ module.exports.show = promisify((options = {}, fn) => {
|
|||
Terminal.focus();
|
||||
},
|
||||
afterClose: (/* exec.series args */) => {
|
||||
fn();
|
||||
fn(null, exitCodeStore());
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
module.exports.hide = hide;
|
||||
|
||||
function hide () {
|
||||
|
|
@ -128,7 +130,9 @@ function create(createOptions) {
|
|||
}
|
||||
});
|
||||
|
||||
Socket.on('exit', () => {
|
||||
Socket.on('exit', (code) => {
|
||||
exitCodeStore(code);
|
||||
|
||||
if (autoClose)
|
||||
return hide();
|
||||
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@
|
|||
"extract-text-webpack-plugin": "^4.0.0-alpha.0",
|
||||
"fast-async": "^7.0.6",
|
||||
"file-loader": "^3.0.1",
|
||||
"gritty": "^4.0.0",
|
||||
"gritty": "^4.6.0",
|
||||
"gunzip-maybe": "^1.3.1",
|
||||
"html-looks-like": "^1.0.2",
|
||||
"html-webpack-plugin": "^3.0.7",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue