Skip to content

Commit

Permalink
fixup! fixup! fixup! feat: use largest writable tmpfs that allows exe…
Browse files Browse the repository at this point in the history
…cutables
  • Loading branch information
hugojosefson committed Mar 31, 2024
1 parent 6b7b174 commit 57a131b
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 8 deletions.
15 changes: 13 additions & 2 deletions example
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,19 @@ ensure_command_installed() {
fi
}

DENO_VERSION_RANGE_URL_ENCODED="$(printf "%s" "${DENO_VERSION_RANGE}" | xxd -p | tr -d '\n' | sed 's/\(..\)/%\1/g')"
DENO_VERSION_RANGE_URL_ENCODED="$(printf "%s" "${DENO_VERSION_RANGE}" | xxd -p | tr -d '\n' | sed 's/\(..\)/%\1/g')"
percent_encode() {
str="$1"
len=$(printf "%s" "$str" | wc -c)
i=1
while [ $i -le $len ]
do
char=$(printf "%s" "$str" | cut -c $i)
printf '%%%02X' "'$char"
i=$((i+1))
done
}

DENO_VERSION_RANGE_URL_ENCODED="$(percent_encode "${DENO_VERSION_RANGE}")"
DEFAULT_DENO="$(command -v deno || true)"

get_largest_usable_tmpfs() {
Expand Down
14 changes: 13 additions & 1 deletion example-piped
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,19 @@ ensure_command_installed() {
fi
}

DENO_VERSION_RANGE_URL_ENCODED="$(printf "%s" "${DENO_VERSION_RANGE}" | xxd -p | tr -d '\n' | sed 's/\(..\)/%\1/g')"
percent_encode() {
str="$1"
len=$(printf "%s" "$str" | wc -c)
i=1
while [ $i -le $len ]
do
char=$(printf "%s" "$str" | cut -c $i)
printf '%%%02X' "'$char"
i=$((i+1))
done
}

DENO_VERSION_RANGE_URL_ENCODED="$(percent_encode "${DENO_VERSION_RANGE}")"
DEFAULT_DENO="$(command -v deno || true)"

get_largest_usable_tmpfs() {
Expand Down
14 changes: 13 additions & 1 deletion example-piped.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,19 @@ ensure_command_installed() {
fi
}

DENO_VERSION_RANGE_URL_ENCODED="$(printf "%s" "${DENO_VERSION_RANGE}" | xxd -p | tr -d '\n' | sed 's/\(..\)/%\1/g')"
percent_encode() {
str="$1"
len=$(printf "%s" "$str" | wc -c)
i=1
while [ $i -le $len ]
do
char=$(printf "%s" "$str" | cut -c $i)
printf '%%%02X' "'$char"
i=$((i+1))
done
}

DENO_VERSION_RANGE_URL_ENCODED="$(percent_encode "${DENO_VERSION_RANGE}")"
DEFAULT_DENO="$(command -v deno || true)"

get_largest_usable_tmpfs() {
Expand Down
15 changes: 13 additions & 2 deletions example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,19 @@ ensure_command_installed() {
fi
}

DENO_VERSION_RANGE_URL_ENCODED="$(printf "%s" "${DENO_VERSION_RANGE}" | xxd -p | tr -d '\n' | sed 's/\(..\)/%\1/g')"
DENO_VERSION_RANGE_URL_ENCODED="$(printf "%s" "${DENO_VERSION_RANGE}" | xxd -p | tr -d '\n' | sed 's/\(..\)/%\1/g')"
percent_encode() {
str="$1"
len=$(printf "%s" "$str" | wc -c)
i=1
while [ $i -le $len ]
do
char=$(printf "%s" "$str" | cut -c $i)
printf '%%%02X' "'$char"
i=$((i+1))
done
}

DENO_VERSION_RANGE_URL_ENCODED="$(percent_encode "${DENO_VERSION_RANGE}")"
DEFAULT_DENO="$(command -v deno || true)"

get_largest_usable_tmpfs() {
Expand Down
14 changes: 13 additions & 1 deletion src/deno-shebang-piped.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,19 @@ ensure_command_installed() {
fi
}

DENO_VERSION_RANGE_URL_ENCODED="$(printf "%s" "${DENO_VERSION_RANGE}" | xxd -p | tr -d '\n' | sed 's/\(..\)/%\1/g')"
percent_encode() {
str="$1"
len=$(printf "%s" "$str" | wc -c)
i=1
while [ $i -le $len ]
do
char=$(printf "%s" "$str" | cut -c $i)
printf '%%%02X' "'$char"
i=$((i+1))
done
}

DENO_VERSION_RANGE_URL_ENCODED="$(percent_encode "${DENO_VERSION_RANGE}")"
DEFAULT_DENO="$(command -v deno || true)"

get_largest_usable_tmpfs() {
Expand Down
14 changes: 13 additions & 1 deletion src/deno-shebang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,19 @@ ensure_command_installed() {
fi
}

DENO_VERSION_RANGE_URL_ENCODED="$(printf "%s" "${DENO_VERSION_RANGE}" | xxd -p | tr -d '\n' | sed 's/\(..\)/%\1/g')"
percent_encode() {
str="$1"
len=$(printf "%s" "$str" | wc -c)
i=1
while [ $i -le $len ]
do
char=$(printf "%s" "$str" | cut -c $i)
printf '%%%02X' "'$char"
i=$((i+1))
done
}

DENO_VERSION_RANGE_URL_ENCODED="$(percent_encode "${DENO_VERSION_RANGE}")"
DEFAULT_DENO="$(command -v deno || true)"

get_largest_usable_tmpfs() {
Expand Down

0 comments on commit 57a131b

Please sign in to comment.