Skip to content

Commit

Permalink
qt-cpp: Use variable instead of raw string
Browse files Browse the repository at this point in the history
  • Loading branch information
OrkunTokdemir committed Jan 14, 2025
1 parent 5c46595 commit 7f03010
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions qt-cpp/src/kit-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const CMAKE_GLOBAL_KITS_FILEPATH = path.join(
'cmake-tools-kits.json'
);

const envPath = '${env:PATH}';
type Environment = Record<string, string | undefined>;

interface CMakeGenerator {
Expand Down Expand Up @@ -357,7 +358,7 @@ export class KitManager {
}
tempPath.push(value);
}
tempPath.push('${env:PATH}');
tempPath.push(envPath);
// Remove duplicates
const pathEnv = Array.from(new Set(tempPath)).join(path.delimiter);
kit.environmentVariables = {
Expand Down Expand Up @@ -512,9 +513,7 @@ export class KitManager {
return undefined;
}
const installationBinDir = path.join(installation, 'bin');
const QtPathAddition = [installationBinDir, '${env:PATH}'].join(
path.delimiter
);
const QtPathAddition = [installationBinDir, envPath].join(path.delimiter);
return QtPathAddition;
}

Expand Down

0 comments on commit 7f03010

Please sign in to comment.