提交 102dbaaa 编写于 作者: L Logan Ramos

Make callbacks async

上级 6432f0bf
...@@ -68,25 +68,22 @@ export class TerminalProcess implements ITerminalChildProcess, IDisposable { ...@@ -68,25 +68,22 @@ export class TerminalProcess implements ITerminalChildProcess, IDisposable {
conptyInheritCursor: true conptyInheritCursor: true
}; };
const cwdVerification = stat(cwd).then(stat => { const cwdVerification = stat(cwd).then(async stat => {
if (!stat.isDirectory()) { if (!stat.isDirectory()) {
return Promise.reject(SHELL_CWD_INVALID_EXIT_CODE); return Promise.reject(SHELL_CWD_INVALID_EXIT_CODE);
} }
return; }, async err => {
}, err => {
if (err && err.code === 'ENOENT') { if (err && err.code === 'ENOENT') {
// So we can include in the error message the specified CWD // So we can include in the error message the specified CWD
shellLaunchConfig.cwd = cwd; shellLaunchConfig.cwd = cwd;
return Promise.reject(SHELL_CWD_INVALID_EXIT_CODE); return Promise.reject(SHELL_CWD_INVALID_EXIT_CODE);
} }
return;
}); });
const exectuableVerification = stat(shellLaunchConfig.executable!).then(stat => { const exectuableVerification = stat(shellLaunchConfig.executable!).then(async stat => {
if (!stat.isFile() && !stat.isSymbolicLink()) { if (!stat.isFile() && !stat.isSymbolicLink()) {
return Promise.reject(stat.isDirectory() ? SHELL_PATH_DIRECTORY_EXIT_CODE : SHELL_PATH_INVALID_EXIT_CODE); return Promise.reject(stat.isDirectory() ? SHELL_PATH_DIRECTORY_EXIT_CODE : SHELL_PATH_INVALID_EXIT_CODE);
} }
return;
}, async (err) => { }, async (err) => {
if (err && err.code === 'ENOENT') { if (err && err.code === 'ENOENT') {
let cwd = shellLaunchConfig.cwd instanceof URI ? shellLaunchConfig.cwd.path : shellLaunchConfig.cwd!; let cwd = shellLaunchConfig.cwd instanceof URI ? shellLaunchConfig.cwd.path : shellLaunchConfig.cwd!;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册