Skip to content

Commit 9d4238b

Browse files
authored
Fix bug with cwd in build tasks. (#6954)
1 parent 9ba19af commit 9d4238b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Extension/src/Debugger/configurationProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ class CppConfigurationProvider implements vscode.DebugConfigurationProvider {
190190
// This property will be removed before writing the DebugConfiguration in launch.json.
191191
newConfig.detail = task.detail ? task.detail : definition.command;
192192
const isCl: boolean = compilerName === "cl.exe";
193-
newConfig.cwd = isWindows && !isCl && !process.env.PATH?.includes(compilerPath) ? path.dirname(compilerPath) : "${workspaceFolder}";
193+
newConfig.cwd = isWindows && !isCl && !process.env.PATH?.includes(path.dirname(compilerPath)) ? path.dirname(compilerPath) : "${workspaceFolder}";
194194

195195
return new Promise<vscode.DebugConfiguration>(resolve => {
196196
if (platform === "darwin") {

Extension/src/LanguageServer/cppBuildTaskProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export class CppBuildTaskProvider implements TaskProvider {
169169
if (compilerArgs && compilerArgs.length > 0) {
170170
args = args.concat(compilerArgs);
171171
}
172-
const cwd: string = isWindows && !isCl && !process.env.PATH?.includes(compilerPath) ? path.dirname(compilerPath) : "${workspaceFolder}";
172+
const cwd: string = isWindows && !isCl && !process.env.PATH?.includes(path.dirname(compilerPath)) ? path.dirname(compilerPath) : "${workspaceFolder}";
173173
const options: cp.ExecOptions | undefined = { cwd: cwd };
174174
definition = {
175175
type: CppBuildTaskProvider.CppBuildScriptType,

0 commit comments

Comments
 (0)