From 102dbaaa4136b21c599b54ae1456bbfcfaeb60a2 Mon Sep 17 00:00:00 2001 From: Logan Ramos Date: Fri, 5 Jul 2019 11:37:11 -0700 Subject: [PATCH] Make callbacks async --- .../workbench/contrib/terminal/node/terminalProcess.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/node/terminalProcess.ts b/src/vs/workbench/contrib/terminal/node/terminalProcess.ts index 89ccf31644e..8b61a562d8d 100644 --- a/src/vs/workbench/contrib/terminal/node/terminalProcess.ts +++ b/src/vs/workbench/contrib/terminal/node/terminalProcess.ts @@ -68,25 +68,22 @@ export class TerminalProcess implements ITerminalChildProcess, IDisposable { conptyInheritCursor: true }; - const cwdVerification = stat(cwd).then(stat => { + const cwdVerification = stat(cwd).then(async stat => { if (!stat.isDirectory()) { return Promise.reject(SHELL_CWD_INVALID_EXIT_CODE); } - return; - }, err => { + }, async err => { if (err && err.code === 'ENOENT') { // So we can include in the error message the specified CWD shellLaunchConfig.cwd = cwd; 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()) { return Promise.reject(stat.isDirectory() ? SHELL_PATH_DIRECTORY_EXIT_CODE : SHELL_PATH_INVALID_EXIT_CODE); } - return; }, async (err) => { if (err && err.code === 'ENOENT') { let cwd = shellLaunchConfig.cwd instanceof URI ? shellLaunchConfig.cwd.path : shellLaunchConfig.cwd!; -- GitLab