Skip to content

Commit

Permalink
Merge pull request #1475 from buffcode/patch-1
Browse files Browse the repository at this point in the history
fix: allow absolute paths to Dangerfile
  • Loading branch information
orta authored Feb 5, 2025
2 parents 03569dc + 5bf0a30 commit b07053c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/runner/runners/inline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ export const runDangerfileEnvironment = async (
d("Started parsing Dangerfile: ", filename)
let optionalExport
if (filename.endsWith(".mts")) {
const tmpFileName = path.join(process.cwd(), `._dangerfile.mjs`)
const tmpFileName = path.resolve(process.cwd(), `._dangerfile.mjs`)
fs.writeFileSync(tmpFileName, compiled)
// tried but data urls have trouble with imports and I don't know how to fix
// optionalExport = (await import(`data:text/javascript;base64,${btoa(compiled)}`));
optionalExport = await import(tmpFileName)
} else if (filename.endsWith(".mjs")) {
optionalExport = await import(path.join(process.cwd(), filename))
optionalExport = await import(path.resolve(process.cwd(), filename))
} else {
optionalExport = _require(compiled, filename, {})
}
Expand Down

0 comments on commit b07053c

Please sign in to comment.