Skip to content

Commit

Permalink
Fix compile task when using official's deno
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecrs committed Mar 29, 2024
1 parent 7f0b34f commit f2338b6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//--------------------------------------- ci/cd/admin
"coverage" : "scripts/run-coverage.sh",
"typecheck": "deno check ./entrypoint.ts",
"compile": "DENORT_BIN=\"$(dirname \"$(which deno)\")/denort\" deno compile --lock=deno.lock --allow-read --allow-write --allow-net --allow-run --allow-env --allow-ffi --unstable-ffi --unstable-fs --output $INIT_CWD/pkgx ./entrypoint.ts",
"compile": "scripts/compile.sh",
"benchmark": "deno task compile &>/dev/null && deno bench --allow-run --allow-env --seed=250 benchmarks"
},
"pkgx": "deno~1.42.0",
Expand Down
14 changes: 14 additions & 0 deletions scripts/compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

# this is only available when using pkgx's deno
DENORT_BIN="$(dirname "$(which deno)")/denort"

if [[ -f "$DENORT_BIN" ]]; then
export DENORT_BIN
else
unset DENORT_BIN
fi

exec deno compile --lock=deno.lock --allow-read --allow-write --allow-net \
--allow-run --allow-env --allow-ffi --unstable-ffi --unstable-fs \
--output "$INIT_CWD/pkgx" ./entrypoint.ts

0 comments on commit f2338b6

Please sign in to comment.