mirror of
https://github.com/casjaysdevdocker/deno
synced 2025-01-18 12:34:21 -05:00
🗃️ Committing everything that changed 🗃️
This commit is contained in:
parent
48c40f8c22
commit
3c4f010df0
@ -17,51 +17,40 @@
|
|||||||
# Set bash options
|
# Set bash options
|
||||||
[ -n "$DEBUG" ] && set -x
|
[ -n "$DEBUG" ] && set -x
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
__get_file() {
|
|
||||||
local exitStatus=""
|
|
||||||
if curl -q -LSf "$1" -o "$FILE"; then
|
|
||||||
LATEST_URL=""
|
|
||||||
exitStatus=0
|
|
||||||
elif curl -q -LSf "$1" -o "$FILE"; then
|
|
||||||
exitStatus=0
|
|
||||||
else
|
|
||||||
exitStatus=1
|
|
||||||
fi
|
|
||||||
return ${exitStatus}
|
|
||||||
}
|
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
DENO_VERSION="${DENO_VERSION:-v1.26.1}"
|
DENO_VERSION="${DENO_VERSION:-v1.26.1}"
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
if [ "$(uname -m)" = "amd64" ] || [ "$(uname -m)" = "x86_64" ]; then
|
if [ "$(uname -m)" = "amd64" ] || [ "$(uname -m)" = "x86_64" ]; then
|
||||||
ARCH="x86_64"
|
ARCH="x86_64"
|
||||||
BIN_FILE="/usr/bin/deno"
|
|
||||||
FILE="/tmp/deno-$ARCH.zip"
|
|
||||||
TMP_DIR="/tmp/deno-$ARCH/deno"
|
|
||||||
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"
|
BIN_FILE="/usr/bin/deno"
|
||||||
|
TMP_DIR="/tmp/deno-$ARCH"
|
||||||
|
FILE="/tmp/deno-$ARCH.zip"
|
||||||
|
message="grabbing $DENO_VERSION from denoland for $ARCH"
|
||||||
|
err_mess="Failed to download deno from $URL"
|
||||||
elif [ "$(uname -m)" = "arm64" ] || [ "$(uname -m)" = "aarch64" ]; then
|
elif [ "$(uname -m)" = "arm64" ] || [ "$(uname -m)" = "aarch64" ]; then
|
||||||
ARCH="arm64"
|
ARCH="arm64"
|
||||||
|
URL="https://github.com/LukeChannings/deno-arm64/releases/download/$DENO_VERSION/deno-linux-$ARCH.zip"
|
||||||
BIN_FILE="/usr/bin/deno"
|
BIN_FILE="/usr/bin/deno"
|
||||||
|
TMP_DIR="/tmp/deno-$ARCH"
|
||||||
FILE="/tmp/deno-$ARCH.zip"
|
FILE="/tmp/deno-$ARCH.zip"
|
||||||
message="grabbing $DENO_VERSION from LukeChannings for $ARCH"
|
message="grabbing $DENO_VERSION from LukeChannings for $ARCH"
|
||||||
URL="https://github.com/LukeChannings/deno-arm64/releases/download/$DENO_VERSION/deno-linux-$ARCH.zip"
|
err_mess="Failed to download deno from $URL"
|
||||||
LATEST_URL="https://github.com/LukeChannings/deno-arm64/releases/latest/download/deno-linux-$ARCH.zip"
|
|
||||||
else
|
else
|
||||||
echo "Unsupported architecture"
|
echo "Unsupported architecture"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
if { __get_file "$URL" || __get_file "$LATEST_URL"; } && [ -f "$FILE" ]; then
|
echo "$message"
|
||||||
echo "$message"
|
if curl -q -LSsf -o "$FILE" "$URL"; 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"
|
|
||||||
else
|
else
|
||||||
echo "Failed to download deno from ${LATEST_URL:-$URL}"
|
echo "$err_mess"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
rm -Rf "$FILE" "$TMP_DIR"
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
[ -f "$(which "deno")" ] && deno upgrade && exit 0 || exit 10
|
[ -f "$(which "deno")" ] && deno upgrade && exit 0 || exit 10
|
||||||
|
Loading…
x
Reference in New Issue
Block a user