Skip to content

Commit

Permalink
feat: use largest writable tmpfs that allows executables
Browse files Browse the repository at this point in the history
refactor: github actions workflow
  • Loading branch information
hugojosefson committed Apr 1, 2024
1 parent 38f91d5 commit ac63f58
Show file tree
Hide file tree
Showing 18 changed files with 316 additions and 199 deletions.
122 changes: 67 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,93 +8,99 @@ on:
branches: "*"

jobs:
meta:
runs-on: ubuntu-latest
dot_deno_version:
runs-on: ubuntu-22.04
outputs:
deno-version: ${{ steps.meta.outputs.deno-version }}
value: ${{ steps.dot_deno_version.outputs.value }}
steps:
- uses: actions/checkout@v3
- id: meta
- uses: actions/checkout@v4
- id: dot_deno_version
run: |
echo "deno-version=$(cat .deno-version)" >> "${GITHUB_OUTPUT}"
echo "value=$(cat .deno-version)" >> "${GITHUB_OUTPUT}"
make:
runs-on: "${{ matrix.os }}-latest"
needs: meta
name: "${{ matrix.os }}: make ${{ matrix.target }} w/ deno ${{ matrix.deno-version }}"
runs-on: "${{ matrix.os }}"
needs: dot_deno_version
name: "${{ matrix.os }}: make ${{ matrix.target }} w/ deno ${{ matrix.deno_version }}"

strategy:
fail-fast: false
matrix:
os:
- "ubuntu"
- "macos"
- "ubuntu-20.04"
- "ubuntu-22.04"
- "macos-13"
- "macos-14"
target:
- "clean all"
- "test"
- "docker-test"
- "docker-output-test"
deno-version:
deno_version:
- "not installed"
- "1.0.0"
- "${{ needs.meta.outputs.deno-version }}"
- "${{ needs.dot_deno_version.outputs.value }}"
- "^1"
exclude:
- target: "docker-output-test"
deno-version: "1.0.0"
- os: "macos"
target: "clean all"
- os: "macos"
target: "docker-test"
- os: "macos"
# don't run target "docker-output-test" with deno_version "not installed"
- deno_version: "not installed"
target: "docker-output-test"
steps:
- uses: actions/checkout@v3

- name: setup deno ${{ matrix.deno-version }}
uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno-version }}
# otherwise, run on linux

- name: make ${{ matrix.target }}
run: make ${{ matrix.target }}
# deno 1.0.0 was never released for macos
- os: "macos-13"
deno_version: "1.0.0"
- os: "macos-14"
deno_version: "1.0.0"

make-from-scratch:
runs-on: "${{ matrix.os }}-latest"
name: "${{ matrix.os }}: make ${{ matrix.target }} w/o deno"

strategy:
fail-fast: false
matrix:
os:
- "ubuntu"
- "macos"
target:
- "clean all"
- "test"
- "docker-test"
exclude:
- os: "macos"
# only run target "test" on macos
- os: "macos-13"
target: "clean all"
- os: "macos"
- os: "macos-13"
target: "docker-test"
- os: "macos-13"
target: "docker-output-test"
- os: "macos-14"
target: "clean all"
- os: "macos-14"
target: "docker-test"
- os: "macos-14"
target: "docker-output-test"

steps:
- uses: actions/checkout@v3
- id: needs_deno_installed
name: Check whether to install deno before
shell: bash
run: |
set -euo pipefail
IFS=$'\n\t'
if [[ "${{ matrix.deno_version }}" == "not installed" ]]; then
echo "value=false" >> "${GITHUB_OUTPUT}"
else
echo "value=true" >> "${GITHUB_OUTPUT}"
fi
- name: delete any deno binaries on PATH
- uses: actions/checkout@v4

- name: Delete any deno binaries on PATH
if: steps.needs_deno_installed.outputs.value == 'false'
shell: bash
run: |
set -e
set -euo pipefail
IFS=$'\n\t'
delete_next_deno() {
deno_path="$(command -v deno)"
if [ -z "$deno_path" ]; then
local deno_path
deno_path="$(command -v deno || :)"
if [[ -z "${deno_path}" ]]; then
return 1
fi
if ! [ -x "$deno_path" ]; then
if ! [[ -x "${deno_path}" ]]; then
return 1
fi
echo "deleting $deno_path"
rm -f "$deno_path"
echo "deleting ${deno_path}"
rm -f "${deno_path}"
}
while delete_next_deno; do
Expand All @@ -103,5 +109,11 @@ jobs:
! deno --version
- name: make ${{ matrix.target }}
- name: Setup deno ${{ matrix.deno-version }}
if: steps.needs_deno_installed.outputs.value == 'true'
uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno-version }}

- name: Run "make ${{ matrix.target }}"
run: make ${{ matrix.target }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:11-slim
FROM debian:12-slim
LABEL maintainer="Hugo Josefson <[email protected]> https://www.hugojosefson.com/"

RUN apt-get update && apt-get -y install sudo make docker.io
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test/import-test-piped.sh: src/deno-shebang-piped.min.sh test/import-test.ts

docker-test:
docker build -t deno-shebang-test .
docker run --rm -i -v "/var/run/docker.sock:/var/run/docker.sock:Z" deno-shebang-test make --always-make all
docker run --rm -i -v "$$(./find-docker-sock):/var/run/docker.sock:Z" deno-shebang-test make --always-make all
@echo "'make all' was successful inside Docker."

docker-output-test: ./test/output.test.ts example example.min example.ts example.min.ts
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ in a Deno-compatible `.ts` or `.js` file, to make it standalone self-executable:

```typescript
#!/bin/sh
// 2>/dev/null;DENO_VERSION_RANGE="^1.42.0";DENO_RUN_ARGS="-q";set -e;V="$DENO_VERSION_RANGE";A="$DENO_RUN_ARGS";h(){ [ -x "$(command -v $1 2>&1)" ];};g(){ u="$([ $(id -u) != 0 ]&&echo sudo||:)";if h brew;then echo "brew install $1";elif h apt;then echo "($u apt update && $u DEBIAN_FRONTEND=noninteractive apt install -y $1)";elif h yum;then echo "$u yum install -y $1";elif h pacman;then echo "$u pacman -yS --noconfirm $1";elif h opkg-install;then echo "$u opkg-install $1";fi;};p(){ q="$(g $1)";if [ -z "$q" ];then echo "Please install '$1' manually, then try again.">&2;exit 1;fi;eval "o=\"\$(set +o)\";set -x;$q;set +x;eval \"\$o\"">&2;};f(){ h "$1"||p "$1";};U="$(printf "%s" "$V"|xxd -p|tr -d '\n'|sed 's/\(..\)/%\1/g')";D="$(command -v deno||true)";t(){ d="$(mktemp)";rm "${d}";dirname "${d}";};a(){ [ -n $D ];};s(){ a&&[ -x "$R/deno" ]&&[ "$R/deno" = "$D" ]&&return;deno eval "import{satisfies as e}from'https://deno.land/x/[email protected]/mod.ts';Deno.exit(e(Deno.version.deno,'$V')?0:1);">/dev/null 2>&1;};e(){ R="$(t)/deno-range-$V/bin";mkdir -p "$R";export PATH="$R:$PATH";[ -x "$R/deno" ]&&return;a&&s&&([ -L "$R/deno" ]||ln -s "$D" "$R/deno")&&return;f curl;v="$(curl -sSfL "https://semver-version.deno.dev/api/github/denoland/deno/$U")";i="$(t)/deno-$v";[ -L "$R/deno" ]||ln -s "$i/bin/deno" "$R/deno";s && return;f unzip;([ "${A#*-q}" != "$A" ]&&exec 2>/dev/null;curl -fsSL https://deno.land/install.sh|DENO_INSTALL="$i" sh -s $DENO_INSTALL_ARGS "$v">&2);};e;exec "$R/deno" run $A "$0" "$@"
// 2>/dev/null;DENO_VERSION_RANGE="^1.42.0";DENO_RUN_ARGS="";set -e;V="$DENO_VERSION_RANGE";A="$DENO_RUN_ARGS";h(){ [ -x "$(command -v "$1" 2>&1)" ];};g(){ u="$([ "$(id -u)" != 0 ]&&echo sudo||:)";if h brew;then echo "brew install $1";elif h apt;then echo "($u apt update && $u DEBIAN_FRONTEND=noninteractive apt install -y $1)";elif h yum;then echo "$u yum install -y $1";elif h pacman;then echo "$u pacman -yS --noconfirm $1";elif h opkg-install;then echo "$u opkg-install $1";fi;};p(){ q="$(g "$1")";if [ -z "$q" ];then echo "Please install '$1' manually, then try again.">&2;exit 1;fi;eval "o=\"\$(set +o)\";set -x;$q;set +x;eval \"\$o\"">&2;};f(){ h "$1"||p "$1";};w(){ [ -n "$1" ] && "$1" -V >/dev/null 2>&1;};U="$(l=$(printf "%s" "$V"|wc -c);for i in $(seq 1 $l);do c=$(printf "%s" "$V"|cut -c $i);printf '%%%02X' "'$c";done)";D="$(w "$(command -v deno||:)"||:)";t(){ ! h findmnt&&echo "${TMPDIR:-/tmp}"&&return;d="$(for i in $(findmnt -Ononoexec,noro -ttmpfs -nboAVAIL,TARGET|sort -rn|cut -d\ -f2);do [ -d "$i" ] && echo "$i" && break || :;done)";echo "${d:-"${TMPDIR:-/tmp}"}";};s(){ deno eval "import{satisfies as e}from'https://deno.land/x/[email protected]/mod.ts';Deno.exit(e(Deno.version.deno,'$V')?0:1);">/dev/null 2>&1;};e(){ R="$(t)/deno-range-$V/bin";mkdir -p "$R";export PATH="$R:$PATH";s&&return;f curl;v="$(curl -sSfL "https://semver-version.deno.dev/api/github/denoland/deno/$U")";i="$(t)/deno-$v";ln -sf "$i/bin/deno" "$R/deno";s && return;f unzip;([ "${A#*-q}" != "$A" ]&&exec 2>/dev/null;curl -fsSL https://deno.land/install.sh|DENO_INSTALL="$i" sh -s $DENO_INSTALL_ARGS "$v">&2);};e;exec deno run $A "$0" "$@"
```

It automatically downloads a correct version of the single
Expand Down Expand Up @@ -38,7 +38,7 @@ Copy/paste this two-liner, into the beginning of your TypeScript file:

```typescript
#!/bin/sh
// 2>/dev/null;DENO_VERSION_RANGE="^1.42.0";DENO_RUN_ARGS="-q";set -e;V="$DENO_VERSION_RANGE";A="$DENO_RUN_ARGS";h(){ [ -x "$(command -v $1 2>&1)" ];};g(){ u="$([ $(id -u) != 0 ]&&echo sudo||:)";if h brew;then echo "brew install $1";elif h apt;then echo "($u apt update && $u DEBIAN_FRONTEND=noninteractive apt install -y $1)";elif h yum;then echo "$u yum install -y $1";elif h pacman;then echo "$u pacman -yS --noconfirm $1";elif h opkg-install;then echo "$u opkg-install $1";fi;};p(){ q="$(g $1)";if [ -z "$q" ];then echo "Please install '$1' manually, then try again.">&2;exit 1;fi;eval "o=\"\$(set +o)\";set -x;$q;set +x;eval \"\$o\"">&2;};f(){ h "$1"||p "$1";};U="$(printf "%s" "$V"|xxd -p|tr -d '\n'|sed 's/\(..\)/%\1/g')";D="$(command -v deno||true)";t(){ d="$(mktemp)";rm "${d}";dirname "${d}";};a(){ [ -n $D ];};s(){ a&&[ -x "$R/deno" ]&&[ "$R/deno" = "$D" ]&&return;deno eval "import{satisfies as e}from'https://deno.land/x/[email protected]/mod.ts';Deno.exit(e(Deno.version.deno,'$V')?0:1);">/dev/null 2>&1;};e(){ R="$(t)/deno-range-$V/bin";mkdir -p "$R";export PATH="$R:$PATH";[ -x "$R/deno" ]&&return;a&&s&&([ -L "$R/deno" ]||ln -s "$D" "$R/deno")&&return;f curl;v="$(curl -sSfL "https://semver-version.deno.dev/api/github/denoland/deno/$U")";i="$(t)/deno-$v";[ -L "$R/deno" ]||ln -s "$i/bin/deno" "$R/deno";s && return;f unzip;([ "${A#*-q}" != "$A" ]&&exec 2>/dev/null;curl -fsSL https://deno.land/install.sh|DENO_INSTALL="$i" sh -s $DENO_INSTALL_ARGS "$v">&2);};e;exec "$R/deno" run $A "$0" "$@"
// 2>/dev/null;DENO_VERSION_RANGE="^1.42.0";DENO_RUN_ARGS="";set -e;V="$DENO_VERSION_RANGE";A="$DENO_RUN_ARGS";h(){ [ -x "$(command -v "$1" 2>&1)" ];};g(){ u="$([ "$(id -u)" != 0 ]&&echo sudo||:)";if h brew;then echo "brew install $1";elif h apt;then echo "($u apt update && $u DEBIAN_FRONTEND=noninteractive apt install -y $1)";elif h yum;then echo "$u yum install -y $1";elif h pacman;then echo "$u pacman -yS --noconfirm $1";elif h opkg-install;then echo "$u opkg-install $1";fi;};p(){ q="$(g "$1")";if [ -z "$q" ];then echo "Please install '$1' manually, then try again.">&2;exit 1;fi;eval "o=\"\$(set +o)\";set -x;$q;set +x;eval \"\$o\"">&2;};f(){ h "$1"||p "$1";};w(){ [ -n "$1" ] && "$1" -V >/dev/null 2>&1;};U="$(l=$(printf "%s" "$V"|wc -c);for i in $(seq 1 $l);do c=$(printf "%s" "$V"|cut -c $i);printf '%%%02X' "'$c";done)";D="$(w "$(command -v deno||:)"||:)";t(){ ! h findmnt&&echo "${TMPDIR:-/tmp}"&&return;d="$(for i in $(findmnt -Ononoexec,noro -ttmpfs -nboAVAIL,TARGET|sort -rn|cut -d\ -f2);do [ -d "$i" ] && echo "$i" && break || :;done)";echo "${d:-"${TMPDIR:-/tmp}"}";};s(){ deno eval "import{satisfies as e}from'https://deno.land/x/[email protected]/mod.ts';Deno.exit(e(Deno.version.deno,'$V')?0:1);">/dev/null 2>&1;};e(){ R="$(t)/deno-range-$V/bin";mkdir -p "$R";export PATH="$R:$PATH";s&&return;f curl;v="$(curl -sSfL "https://semver-version.deno.dev/api/github/denoland/deno/$U")";i="$(t)/deno-$v";ln -sf "$i/bin/deno" "$R/deno";s && return;f unzip;([ "${A#*-q}" != "$A" ]&&exec 2>/dev/null;curl -fsSL https://deno.land/install.sh|DENO_INSTALL="$i" sh -s $DENO_INSTALL_ARGS "$v">&2);};e;exec deno run $A "$0" "$@"
```

### Step 2: `chmod` it
Expand Down Expand Up @@ -95,7 +95,7 @@ script into `sh`:

```typescript
#!/bin/sh
// 2>/dev/null;DENO_VERSION_RANGE="^1.42.0";DENO_RUN_ARGS="-q";set -e;V="$DENO_VERSION_RANGE";A="$DENO_RUN_ARGS";h(){ [ -x "$(command -v $1 2>&1)" ];};g(){ u="$([ $(id -u) != 0 ]&&echo sudo||:)";if h brew;then echo "brew install $1";elif h apt;then echo "($u apt update && $u DEBIAN_FRONTEND=noninteractive apt install -y $1)";elif h yum;then echo "$u yum install -y $1";elif h pacman;then echo "$u pacman -yS --noconfirm $1";elif h opkg-install;then echo "$u opkg-install $1";fi;};p(){ q="$(g $1)";if [ -z "$q" ];then echo "Please install '$1' manually, then try again.">&2;exit 1;fi;eval "o=\"\$(set +o)\";set -x;$q;set +x;eval \"\$o\"">&2;};f(){ h "$1"||p "$1";};U="$(printf "%s" "$V"|xxd -p|tr -d '\n'|sed 's/\(..\)/%\1/g')";D="$(command -v deno||true)";t(){ d="$(mktemp)";rm "${d}";dirname "${d}";};z(){ m="$(command -v "$0"||true)";l="/* 2>/dev/null";! [ -z $m ]&&[ -r $m ]&&[ "$(head -c3 "$m")" = '#!/' ]&&(read x && read y &&[ "$x" = "#!/bin/sh" ]&&[ "$l" != "${y%"$l"*}" ])<"$m";};a(){ [ -n $D ];};s(){ a&&[ -x "$R/deno" ]&&[ "$R/deno" = "$D" ]&&return;deno eval "import{satisfies as e}from'https://deno.land/x/[email protected]/mod.ts';Deno.exit(e(Deno.version.deno,'$V')?0:1);">/dev/null 2>&1;};e(){ R="$(t)/deno-range-$V/bin";mkdir -p "$R";export PATH="$R:$PATH";[ -x "$R/deno" ]&&return;a&&s&&([ -L "$R/deno" ]||ln -s "$D" "$R/deno")&&return;f curl;v="$(curl -sSfL "https://semver-version.deno.dev/api/github/denoland/deno/$U")";i="$(t)/deno-$v";[ -L "$R/deno" ]||ln -s "$i/bin/deno" "$R/deno";s && return;f unzip;([ "${A#*-q}" != "$A" ]&&exec 2>/dev/null;curl -fsSL https://deno.land/install.sh|DENO_INSTALL="$i" sh -s $DENO_INSTALL_ARGS "$v">&2);};e;z&&exec "$R/deno" run $A "$0" "$@";exec "$R/deno" run $A - "$@"<<'//🔚'
// 2>/dev/null;DENO_VERSION_RANGE="^1.42.0";DENO_RUN_ARGS="";set -e;V="$DENO_VERSION_RANGE";A="$DENO_RUN_ARGS";h(){ [ -x "$(command -v "$1" 2>&1)" ];};g(){ u="$([ "$(id -u)" != 0 ]&&echo sudo||:)";if h brew;then echo "brew install $1";elif h apt;then echo "($u apt update && $u DEBIAN_FRONTEND=noninteractive apt install -y $1)";elif h yum;then echo "$u yum install -y $1";elif h pacman;then echo "$u pacman -yS --noconfirm $1";elif h opkg-install;then echo "$u opkg-install $1";fi;};p(){ q="$(g "$1")";if [ -z "$q" ];then echo "Please install '$1' manually, then try again.">&2;exit 1;fi;eval "o=\"\$(set +o)\";set -x;$q;set +x;eval \"\$o\"">&2;};f(){ h "$1"||p "$1";};w(){ [ -n "$1" ] && "$1" -V >/dev/null 2>&1;};U="$(l=$(printf "%s" "$V"|wc -c);for i in $(seq 1 $l);do c=$(printf "%s" "$V"|cut -c $i);printf '%%%02X' "'$c";done)";D="$(w "$(command -v deno||:)"||:)";t(){ ! h findmnt&&echo "${TMPDIR:-/tmp}"&&return;d="$(for i in $(findmnt -Ononoexec,noro -ttmpfs -nboAVAIL,TARGET|sort -rn|cut -d\ -f2);do [ -d "$i" ] && echo "$i" && break || :;done)";echo "${d:-"${TMPDIR:-/tmp}"}";};z(){ m="$(command -v "$0"||true)";l="/* 2>/dev/null";! [ -z "$m" ]&&[ -r "$m" ]&&[ "$(head -c3 "$m")" = '#!/' ]&&(read x && read y &&[ "$x" = "#!/bin/sh" ]&&[ "$l" != "${y%"$l"*}" ])<"$m";};s(){ deno eval "import{satisfies as e}from'https://deno.land/x/[email protected]/mod.ts';Deno.exit(e(Deno.version.deno,'$V')?0:1);">/dev/null 2>&1;};e(){ R="$(t)/deno-range-$V/bin";mkdir -p "$R";export PATH="$R:$PATH";s&&return;f curl;v="$(curl -sSfL "https://semver-version.deno.dev/api/github/denoland/deno/$U")";i="$(t)/deno-$v";ln -sf "$i/bin/deno" "$R/deno";s && return;f unzip;([ "${A#*-q}" != "$A" ]&&exec 2>/dev/null;curl -fsSL https://deno.land/install.sh|DENO_INSTALL="$i" sh -s $DENO_INSTALL_ARGS "$v">&2);};e;z&&exec deno run $A "$0" "$@";exec deno run $A - "$@"<<'//🔚'
```

Using this, you can run both run the script normally from a file, or directly
Expand Down
56 changes: 35 additions & 21 deletions example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* 2>/dev/null

DENO_VERSION_RANGE="^1.42.0"
DENO_RUN_ARGS="--quiet"
DENO_RUN_ARGS=""
# DENO_RUN_ARGS="--quiet --allow-all --unstable" # <-- depending on what you need

set -e
Expand Down Expand Up @@ -48,21 +48,39 @@ ensure_command_installed() {
fi
}

DENO_VERSION_RANGE_URL_ENCODED="$(printf "%s" "${DENO_VERSION_RANGE}" | xxd -p | tr -d '\n' | sed 's/\(..\)/%\1/g')"
DEFAULT_DENO="$(command -v deno || true)"
uri_encode() {
str="$1"
len=$(printf "%s" "$str" | wc -c)
for i in $(seq 1 $len); do
char=$(printf "%s" "$str" | cut -c $i)
printf '%%%02X' "'$char"
done
}

get_tmp_dir() {
tmp_tmp_file="$(mktemp)"
rm "${tmp_tmp_file}"
dirname "${tmp_tmp_file}"
does_deno_work() {
deno="$1"
[ -n "${deno}" ] && "${deno}" --version >/dev/null 2>&1
}

is_any_deno_installed() {
[ -n "${DEFAULT_DENO}" ]
DENO_VERSION_RANGE_URL_ENCODED="$(uri_encode "${DENO_VERSION_RANGE}")"
DEFAULT_DENO="$(does_deno_work "$(command -v deno)" ||:)"

get_tmp_dir() {
if ! has_command findmnt; then
echo "${TMPDIR:-/tmp}"
return
fi
tmpfss="$(findmnt -Ononoexec,noro -ttmpfs -nboAVAIL,TARGET | sort -rn | cut -d\ -f2)"
for tmpfs in "${tmpfss}"; do
if [ -d "${tmpfs}" ]; then
echo "${tmpfs}"
return
fi
done
echo "${TMPDIR:-/tmp}"
}

is_deno_version_satisfied() {
is_any_deno_installed && [ -x "${DENO_RANGE_DIR}/deno" ] && [ "${DENO_RANGE_DIR}/deno" = "${DEFAULT_DENO}" ] && return
does_deno_on_path_satisfy() {
deno eval "import{satisfies as e}from'https://deno.land/x/[email protected]/mod.ts';Deno.exit(e(Deno.version.deno,'${DENO_VERSION_RANGE}')?0:1);" >/dev/null 2>&1
}

Expand All @@ -71,19 +89,16 @@ get_satisfying_version() {
curl -sSfL "https://semver-version.deno.dev/api/github/denoland/deno/${DENO_VERSION_RANGE_URL_ENCODED}"
}

ensure_deno_installed() {
ensure_deno_installed_and_first_on_path() {
DENO_RANGE_DIR="$(get_tmp_dir)/deno-range-${DENO_VERSION_RANGE}/bin"
mkdir -p "${DENO_RANGE_DIR}"
export PATH="${DENO_RANGE_DIR}:${PATH}"

[ -x "${DENO_RANGE_DIR}/deno" ] && return
is_any_deno_installed && is_deno_version_satisfied && ([ -L "${DENO_RANGE_DIR}/deno" ] || ln -s "${DEFAULT_DENO}" "${DENO_RANGE_DIR}/deno") && return
does_deno_on_path_satisfy && return

DENO_VERSION="$(get_satisfying_version)"
DENO_INSTALL="$(get_tmp_dir)/deno-${DENO_VERSION}"
[ -L "${DENO_RANGE_DIR}/deno" ] || ln -s "${DENO_INSTALL}/bin/deno" "${DENO_RANGE_DIR}/deno"

is_deno_version_satisfied && return
ln -fs "${DENO_INSTALL}/bin/deno" "${DENO_RANGE_DIR}/deno"
does_deno_on_path_satisfy && return

ensure_command_installed unzip
ensure_command_installed curl
Expand All @@ -97,9 +112,8 @@ ensure_deno_installed() {
)
}

ensure_deno_installed

exec "${DENO_RANGE_DIR}/deno" run ${DENO_RUN_ARGS} "$0" "$@"
ensure_deno_installed_and_first_on_path
exec deno run ${DENO_RUN_ARGS} "$0" "$@"
//*/
import { readAll } from "https://deno.land/[email protected]/io/read_all.ts";

Expand Down
Loading

0 comments on commit ac63f58

Please sign in to comment.