From 955d48dd41c8090bf8aca4a604e71dfbe8189e70 Mon Sep 17 00:00:00 2001 From: Vladyslav Zhukovskyi Date: Thu, 19 Dec 2019 11:06:26 +0200 Subject: [PATCH] Code fixes Signed-off-by: Vladyslav Zhukovskyi --- .../src/variable/project-path-variable-resolver.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/task-plugin/src/variable/project-path-variable-resolver.ts b/plugins/task-plugin/src/variable/project-path-variable-resolver.ts index efde254c66..023126fbaa 100644 --- a/plugins/task-plugin/src/variable/project-path-variable-resolver.ts +++ b/plugins/task-plugin/src/variable/project-path-variable-resolver.ts @@ -44,8 +44,8 @@ export class ProjectPathVariableResolver { const selections = await theia.commands.executeCommand(SELECTED_CONTEXT_COMMAND); - if (selections !== undefined && selections.length == 1) { - //retrieve project path from selection + if (selections !== undefined && selections.length === 1) { + // retrieve project path from selection const relPath = selections[0].path.substring(this.projectsRoot.length).split('/'); const project = relPath.shift() || relPath.shift(); @@ -53,9 +53,9 @@ export class ProjectPathVariableResolver { value = `${this.projectsRoot}/${project}`; } } else { - //get project folder from workspace folders, first folder in workspaceFolders is .theia + // get project folder from workspace folders, first folder in workspaceFolders is .theia const folders = fs.readdirSync(this.projectsRoot, {withFileTypes: false}); - + if (folders !== undefined && folders.length === 2) { value = `${this.projectsRoot}/${folders[1]}`; }