Skip to content

Commit 5cc2c0e

Browse files
fix: paths
1 parent 7986187 commit 5cc2c0e

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

src/frameworks/cdkFramework.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { AwsConfiguration } from "../types/awsConfiguration.js";
1010
import { LldConfigBase } from "../types/lldConfig.js";
1111
import { Logger } from "../logger.js";
1212
import { Worker } from "node:worker_threads";
13-
import { getModuleDirname } from "../getDirname.js";
13+
import { getModuleDirname, getProjectDirname } from "../getDirname.js";
1414
import { Configuration } from "../configuration.js";
1515

1616
/**
@@ -276,7 +276,11 @@ export class CdkFramework implements IFramework {
276276
},
277277
};
278278

279-
const compileOutput = path.resolve(`${outputFolder}/compiledCdk.js`);
279+
const compileOutput = path.join(
280+
getProjectDirname(),
281+
outputFolder,
282+
`compiledCdk.js`
283+
);
280284
try {
281285
// Build CDK code
282286
await esbuild.build({

src/nodeWorkerRunner.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Logger } from "./logger.mjs";
66

77
Logger.setVerbose(workerData.verbose);
88
Logger.verbose(
9-
`[Function ${workerData.functionId}] [Worker ${workerData.workerId}] Worker started`
9+
`[Function ${workerData.functionId}] [Worker ${workerData.workerId}] Worker started. File: ${workerData.artifactFile}, Handler: ${workerData.handler}`
1010
);
1111

1212
parentPort.on("message", async (data) => {

src/vsCode.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,12 @@ async function getVsCodeLaunchConfig(lldConfig?: LldConfig) {
3434

3535
const moduleDirname = getModuleDirname();
3636
//Logger.log("Module folder", moduleDirname);
37-
const currentFolder = path.resolve();
37+
const projectDirname = getProjectDirname();
38+
3839
//Logger.log("Current folder", currentFolder);
39-
const localFolder = path.join(currentFolder, "node_modules/.bin/lld");
40+
const localFolder = path.resolve(
41+
path.join(projectDirname, "node_modules/.bin/lld")
42+
);
4043

4144
let runtimeExecutableSet = false;
4245

@@ -45,7 +48,10 @@ async function getVsCodeLaunchConfig(lldConfig?: LldConfig) {
4548
Logger.verbose("Lambda Live Debugger is installed locally");
4649
// check if file exists
4750
try {
48-
//Logger.log("Checking local folder", localFolder);
51+
Logger.log(
52+
"Checking local folder for runtimeExecutable setting for VsCode configuration",
53+
localFolder
54+
);
4955
await fs.access(localFolder, fs.constants.F_OK);
5056
config.configurations![0].runtimeExecutable = localRuntimeExecutable;
5157
runtimeExecutableSet = true;
@@ -61,6 +67,7 @@ async function getVsCodeLaunchConfig(lldConfig?: LldConfig) {
6167
Logger.verbose(
6268
`Setting absolute path for runtimeExecutable setting for VsCode configuration`
6369
);
70+
const localFolderSubfolder = path.resolve("node_modules/.bin/lld");
6471
const globalModule1 = path.join(moduleDirname, "..", "..", ".bin/lld");
6572
const globalModule2 = path.join(moduleDirname, "..", "..", "bin/lld");
6673
const globalModule3 = path.join(
@@ -73,6 +80,7 @@ async function getVsCodeLaunchConfig(lldConfig?: LldConfig) {
7380
);
7481
const possibleFolders = {
7582
[localFolder]: "${workspaceFolder}/node_modules/.bin/lld",
83+
[localFolderSubfolder]: localFolderSubfolder,
7684
[globalModule1]: globalModule1,
7785
[globalModule2]: globalModule2,
7886
[globalModule3]: globalModule3,

0 commit comments

Comments
 (0)