mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(package) console-io v9.0.0
This commit is contained in:
parent
08a296b867
commit
9677dcb6bd
2 changed files with 12 additions and 14 deletions
|
|
@ -81,7 +81,7 @@ const getDirPath = () => {
|
|||
return Info.dirPath;
|
||||
};
|
||||
|
||||
const create = promisify((callback) => {
|
||||
const create = async () => {
|
||||
const options = {
|
||||
cwd: getDirPath(),
|
||||
env: getEnv(),
|
||||
|
|
@ -93,14 +93,12 @@ const create = promisify((callback) => {
|
|||
className: 'console',
|
||||
});
|
||||
|
||||
konsole = Console(Element, options, (spawn) => {
|
||||
spawn.on('connect', exec.with(authCheck, spawn));
|
||||
spawn.on('path', config.if('syncConsolePath', onPath));
|
||||
|
||||
CloudCmd.on('active-dir', config.if('syncConsolePath', cd(spawn.handler)));
|
||||
|
||||
exec(callback);
|
||||
});
|
||||
konsole = await Console(Element, options);
|
||||
|
||||
konsole.on('connect', exec.with(authCheck, konsole));
|
||||
konsole.on('path', config.if('syncConsolePath', onPath));
|
||||
|
||||
CloudCmd.on('active-dir', config.if('syncConsolePath', cd(konsole.handler)));
|
||||
|
||||
konsole.addShortCuts({
|
||||
'P': () => {
|
||||
|
|
@ -110,12 +108,12 @@ const create = promisify((callback) => {
|
|||
konsole.setPromptText(command + path);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
function authCheck(spawn) {
|
||||
spawn.emit('auth', config('username'), config('password'));
|
||||
function authCheck(konsole) {
|
||||
konsole.emit('auth', config('username'), config('password'));
|
||||
|
||||
spawn.on('reject', () => {
|
||||
konsole.on('reject', () => {
|
||||
Dialog.alert(TITLE, 'Wrong credentials!');
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@
|
|||
"@cloudcmd/read-files-sync": "^2.0.0",
|
||||
"apart": "^2.0.0",
|
||||
"chalk": "^2.0.1",
|
||||
"console-io": "^8.0.0",
|
||||
"console-io": "^9.0.0",
|
||||
"copymitter": "^4.0.2",
|
||||
"criton": "^1.0.0",
|
||||
"currify": "^3.0.0",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue