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

Commit

Permalink
Support both workspaceRoot and workspaceFolder
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Oct 16, 2018
1 parent c92911b commit 8affa8d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ function resolveToolsGopath(): string {
if (toolsGopathForWorkspace.startsWith('~')) {
toolsGopathForWorkspace = path.join(os.homedir(), toolsGopathForWorkspace.substr(1));
}
if (toolsGopathForWorkspace && toolsGopathForWorkspace.trim() && !/\${workspaceFolder}/.test(toolsGopathForWorkspace)) {
if (toolsGopathForWorkspace && toolsGopathForWorkspace.trim() && !/\${workspaceFolder}|\${workspaceRoot}/.test(toolsGopathForWorkspace)) {
return toolsGopathForWorkspace;
}

Expand Down Expand Up @@ -502,7 +502,7 @@ export function timeout(millis): Promise<void> {
}

/**
* Exapnds ~ to homedir in non-Windows platform and resolves ${workspaceFolder}
* Exapnds ~ to homedir in non-Windows platform and resolves ${workspaceFolder} or ${workspaceRoot}
*/
export function resolvePath(inputPath: string, workspaceFolder?: string): string {
if (!inputPath || !inputPath.trim()) return inputPath;
Expand All @@ -516,7 +516,7 @@ export function resolvePath(inputPath: string, workspaceFolder?: string): string
}

if (workspaceFolder) {
inputPath = inputPath.replace(/\${workspaceFolder}/g, workspaceFolder);
inputPath = inputPath.replace(/\${workspaceFolder}|\${workspaceRoot}/g, workspaceFolder);
}
return resolveHomeDir(inputPath);
}
Expand Down

0 comments on commit 8affa8d

Please # to comment.