Skip to content

Commit b07053c

Browse files
authored
Merge pull request #1475 from buffcode/patch-1
fix: allow absolute paths to Dangerfile
2 parents 03569dc + 5bf0a30 commit b07053c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: source/runner/runners/inline.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ export const runDangerfileEnvironment = async (
107107
d("Started parsing Dangerfile: ", filename)
108108
let optionalExport
109109
if (filename.endsWith(".mts")) {
110-
const tmpFileName = path.join(process.cwd(), `._dangerfile.mjs`)
110+
const tmpFileName = path.resolve(process.cwd(), `._dangerfile.mjs`)
111111
fs.writeFileSync(tmpFileName, compiled)
112112
// tried but data urls have trouble with imports and I don't know how to fix
113113
// optionalExport = (await import(`data:text/javascript;base64,${btoa(compiled)}`));
114114
optionalExport = await import(tmpFileName)
115115
} else if (filename.endsWith(".mjs")) {
116-
optionalExport = await import(path.join(process.cwd(), filename))
116+
optionalExport = await import(path.resolve(process.cwd(), filename))
117117
} else {
118118
optionalExport = _require(compiled, filename, {})
119119
}

0 commit comments

Comments
 (0)