Change configure Jupyter server steps from async to sync (#13937)

* change config steps to sync

* fix tests

* use pathexistsSync

* remove pathExistsSync call

* address PR comments
This commit is contained in:
Lucy Zhang
2021-01-20 15:45:54 -08:00
committed by GitHub
parent 58d4dda1e8
commit 068649cba4
5 changed files with 29 additions and 33 deletions

View File

@@ -22,13 +22,13 @@ export function getLivyUrl(serverName: string, port: string): string {
return this.getKnoxUrl(serverName, port) + '/default/livy/v1/';
}
export async function mkDir(dirPath: string, outputChannel?: vscode.OutputChannel): Promise<void> {
if (!await fs.pathExists(dirPath)) {
if (outputChannel) {
outputChannel.appendLine(localize('mkdirOutputMsg', "... Creating {0}", dirPath));
}
await fs.ensureDir(dirPath);
}
export async function ensureDir(dirPath: string, outputChannel?: vscode.OutputChannel): Promise<void> {
outputChannel?.appendLine(localize('ensureDirOutputMsg', "... Ensuring {0} exists", dirPath));
await fs.ensureDir(dirPath);
}
export function ensureDirSync(dirPath: string, outputChannel?: vscode.OutputChannel): void {
outputChannel?.appendLine(localize('ensureDirOutputMsg', "... Ensuring {0} exists", dirPath));
fs.ensureDirSync(dirPath);
}
export function getErrorMessage(error: Error | string): string {