feature(package) console-io v9.0.0

This commit is contained in:
coderaiser 2018-10-19 23:33:13 +03:00
parent 08a296b867
commit 9677dcb6bd
2 changed files with 12 additions and 14 deletions

View file

@ -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!');
});
}

View file

@ -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",