Skip to content

Commit 3bec0e8

Browse files
fix: runtimeExecutable setting in VsCode configuration
1 parent 27c0020 commit 3bec0e8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/vsCode.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
} from "jsonc-parser";
1111
import { VsCodeLaunch } from "./types/vsCodeConfig.js";
1212
import { LldConfig } from "./types/lldConfig.js";
13-
import { getModuleDirname } from "./getDirname.js";
13+
import { getModuleDirname, getProjectDirname } from "./getDirname.js";
1414
import { Logger } from "./logger.js";
1515

1616
async function getVsCodeLaunchConfig(lldConfig?: LldConfig) {
@@ -54,9 +54,10 @@ async function getVsCodeLaunchConfig(lldConfig?: LldConfig) {
5454
}
5555
}
5656

57-
if (!runtimeExecutableSet) {
58-
const globalModule1 = path.join(moduleDirname, "..", "..", ".bin/lld");
59-
const globalModule2 = path.join(moduleDirname, "..", "..", "bin/lld");
57+
if (runtimeExecutableSet) {
58+
const projectDirname = getProjectDirname();
59+
const globalModule1 = path.join(projectDirname, "..", "..", ".bin/lld");
60+
const globalModule2 = path.join(projectDirname, "..", "..", "bin/lld");
6061
const globalModule3 = path.join(
6162
moduleDirname,
6263
"..",
@@ -165,7 +166,7 @@ async function getCurrentState(): Promise<
165166
filePath: string;
166167
}
167168
> {
168-
const filePath = path.join(path.resolve(), ".vscode/launch.json");
169+
const filePath = path.join(getProjectDirname(), ".vscode/launch.json");
169170

170171
let createNewFile = false;
171172

0 commit comments

Comments
 (0)