Skip to content

Commit

Permalink
Add handling of predefined variable ${workspaceFolderBasename} (#642)
Browse files Browse the repository at this point in the history
Fixes #147
  • Loading branch information
yerseg authored Jun 23, 2024
1 parent eb945ec commit 37ba1e9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ function replacement(name: string): string|undefined {
return path.dirname(vscode.window.activeTextEditor.document.uri.fsPath);
return process.cwd();
}
if (name === 'workspaceFolderBasename' &&
vscode.workspace.rootPath !== undefined) {
return path.basename(vscode.workspace.rootPath);
}
const envPrefix = 'env:';
if (name.startsWith(envPrefix))
return process.env[name.substr(envPrefix.length)] ?? '';
Expand Down

0 comments on commit 37ba1e9

Please sign in to comment.