Skip to content

Commit

Permalink
Fix replacing ${workspaceFolder} in analyze args
Browse files Browse the repository at this point in the history
  • Loading branch information
Discookie committed Feb 2, 2022
1 parent bf5299e commit b8ab95a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/backend/executor/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,20 @@ export class ExecutorBridge implements Disposable {
?? path.join(workspaceFolder, '.codechecker');

const ccArgumentsSetting = workspace.getConfiguration('codechecker.executor').get<string>('arguments');
const ccArguments = parse(ccArgumentsSetting ?? '')

// TODO: Merge this collection with replaceVariables
const env: { [key: string]: string } = {
workspaceFolder,
workspaceRoot: workspaceFolder,
cwd: process.cwd()
};
for (const [key, val] of Object.entries(process.env)) {
if (val !== undefined) {
env[`env.${key}`] = val;
}
}

const ccArguments = parse(ccArgumentsSetting ?? '', env)
.filter((entry) => typeof entry === 'string' && entry.length > 0)
.map((entry) => replaceVariables(entry as string)!);

Expand Down

0 comments on commit b8ab95a

Please sign in to comment.