Skip to content

Commit

Permalink
Normalize drive letter on windows for presets expanision
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielmelody committed Aug 2, 2022
1 parent 4898736 commit 1469f1e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/presetsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ export class PresetsController {
const presetsController = new PresetsController(cmakeTools, kitsController);

const expandSourceDir = async (dir: string) => {
const workspaceFolder = cmakeTools.folder.uri.fsPath;
let workspaceFolder = cmakeTools.folder.uri.fsPath;
if (workspaceFolder.length > 1 && workspaceFolder.charCodeAt(0) > 97 && workspaceFolder.charCodeAt(0) <= 122 && workspaceFolder[1] === ':') {
// Windows drive letter should be uppercase, for consistency with other tools like Visual Studio.
workspaceFolder = workspaceFolder[0] + workspaceFolder[1].toUpperCase() + workspaceFolder.slice(2);
}
const expansionOpts: ExpansionOptions = {
vars: {
workspaceFolder,
Expand Down

0 comments on commit 1469f1e

Please sign in to comment.