Skip to content

Commit 7c6129f

Browse files
committed
core: enable providing fuzz targets using absolute paths
1 parent 5b886e6 commit 7c6129f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/core/core.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,13 @@ export function ensureFilepath(filePath: string): string {
327327
if (!filePath) {
328328
throw Error("Empty filepath provided");
329329
}
330+
331+
const absolutePath = path.isAbsolute(filePath)
332+
? filePath
333+
: path.join(process.cwd(), filePath);
334+
330335
// file: schema is required on Windows
331-
const fullPath = "file://" + path.join(process.cwd(), filePath);
336+
const fullPath = "file://" + absolutePath;
332337
return [".js", ".mjs", ".cjs"].some((suffix) => fullPath.endsWith(suffix))
333338
? fullPath
334339
: fullPath + ".js";

0 commit comments

Comments
 (0)