Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
Code fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Vladyslav Zhukovskyi <vzhukovs@redhat.com>
  • Loading branch information
vzhukovs committed Dec 19, 2019
1 parent 88057b0 commit 955d48d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ export class ProjectPathVariableResolver {

const selections = await theia.commands.executeCommand<Uri[]>(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();

if (project !== undefined) {
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]}`;
}
Expand Down

0 comments on commit 955d48d

Please sign in to comment.