🗃️ Committing everything that changed 🗃️

This commit is contained in:
casjay 2022-10-12 19:19:43 -04:00
parent 66e3acfe1b
commit 48c40f8c22
No known key found for this signature in database
GPG Key ID: 4F765975C1F0EE5F

View File

@ -19,10 +19,10 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__get_file() { __get_file() {
local exitStatus="" local exitStatus=""
if curl -q -LSf "$URL" -o "$FILE"; then if curl -q -LSf "$1" -o "$FILE"; then
LATEST_URL=""
exitStatus=0 exitStatus=0
elif curl -q -LSf "$LATEST_URL" -o "$FILE"; then elif curl -q -LSf "$1" -o "$FILE"; then
URL="$LATEST_URL"
exitStatus=0 exitStatus=0
else else
exitStatus=1 exitStatus=1
@ -37,14 +37,14 @@ if [ "$(uname -m)" = "amd64" ] || [ "$(uname -m)" = "x86_64" ]; then
BIN_FILE="/usr/bin/deno" BIN_FILE="/usr/bin/deno"
FILE="/tmp/deno-$ARCH.zip" FILE="/tmp/deno-$ARCH.zip"
TMP_DIR="/tmp/deno-$ARCH/deno" TMP_DIR="/tmp/deno-$ARCH/deno"
DENO_VERSION="${DENO_VERSION:-latest}" message="grabbing $DENO_VERSION from denoland for $ARCH"
URL="https://github.com/denoland/deno/releases/download/$DENO_VERSION/deno-$ARCH-unknown-linux-gnu.zip" URL="https://github.com/denoland/deno/releases/download/$DENO_VERSION/deno-$ARCH-unknown-linux-gnu.zip"
LATEST_URL="https://github.com/denoland/deno/releases/download/latest/deno-$ARCH-unknown-linux-gnu.zip" LATEST_URL="https://github.com/denoland/deno/releases/download/latest/deno-$ARCH-unknown-linux-gnu.zip"
elif [ "$(uname -m)" = "arm64" ] || [ "$(uname -m)" = "aarch64" ]; then elif [ "$(uname -m)" = "arm64" ] || [ "$(uname -m)" = "aarch64" ]; then
ARCH="arm64" ARCH="arm64"
BIN_FILE="/usr/bin/deno" BIN_FILE="/usr/bin/deno"
FILE="/tmp/deno-$ARCH.zip" FILE="/tmp/deno-$ARCH.zip"
DENO_VERSION="${DENO_VERSION:-latest}" message="grabbing $DENO_VERSION from LukeChannings for $ARCH"
URL="https://github.com/LukeChannings/deno-arm64/releases/download/$DENO_VERSION/deno-linux-$ARCH.zip" URL="https://github.com/LukeChannings/deno-arm64/releases/download/$DENO_VERSION/deno-linux-$ARCH.zip"
LATEST_URL="https://github.com/LukeChannings/deno-arm64/releases/latest/download/deno-linux-$ARCH.zip" LATEST_URL="https://github.com/LukeChannings/deno-arm64/releases/latest/download/deno-linux-$ARCH.zip"
else else
@ -52,33 +52,15 @@ else
exit 1 exit 1
fi fi
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# AMD64 binary if { __get_file "$URL" || __get_file "$LATEST_URL"; } && [ -f "$FILE" ]; then
if [ "$ARCH" = "x86_64" ]; then echo "$message"
echo "grabbing ${DENO_VERSION} from denoland for $ARCH"
__get_file && if [ -f "$FILE" ]; then
mkdir -p "$TMP_DIR" && cd "$TMP_DIR" || exit 10 mkdir -p "$TMP_DIR" && cd "$TMP_DIR" || exit 10
unzip "$FILE" unzip "$FILE"
mv -fv "$TMP_DIR" "$BIN_FILE" mv -fv "$TMP_DIR" "$BIN_FILE"
chmod -Rf 755 "$BIN_FILE" chmod -Rf 755 "$BIN_FILE"
rm -Rf "$FILE" "$TMP_DIR" rm -Rf "$FILE" "$TMP_DIR"
fi
else else
echo "Failed to download deno from $URL" echo "Failed to download deno from ${LATEST_URL:-$URL}"
exit 2
fi
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ARM64 binary
if [ "$ARCH" = "arm64" ]; then
echo "grabbing ${DENO_VERSION} from LukeChannings for $ARCH"
__get_file && if [ -f "$FILE" ]; then
mkdir -p "$TMP_DIR" && cd "$TMP_DIR" || exit 10
unzip "$FILE"
mv -fv "$TMP_DIR" "$BIN_FILE"
chmod -Rf 755 "$BIN_FILE"
rm -Rf "$FILE" "$TMP_DIR"
fi
else
echo "Failed to download deno from $URL"
exit 2 exit 2
fi fi
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -