Skip to content

Commit 16aae75

Browse files
committed
Support specifying version for hhfab
1 parent dc22247 commit 16aae75

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

hhfab

+2-14
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
: ${USE_SUDO:="true"}
2222
: ${DEBUG:="false"}
2323
: ${INSTALL_DIR:="/usr/local/bin"}
24+
: ${TAG:="latest"}
2425

2526
HAS_ORAS="$(type "oras" &> /dev/null && echo true || echo false)"
2627

@@ -75,21 +76,8 @@ verifySupported() {
7576
fi
7677
}
7778

78-
downloadFile() {
79-
DIST="oras_${TAG}_${OS}_${ARCH}.tar.gz"
80-
DOWNLOAD_URL="https://github.com/oras-project/oras/releases/download/v$TAG/$DIST"
81-
TMP_ROOT="$(mktemp -dt oras-XXXXXX)"
82-
TMP_FILE="$TMP_ROOT/$DIST"
83-
echo "Downloading $DOWNLOAD_URL"
84-
if [ "${HAS_CURL}" == "true" ]; then
85-
curl -SsL "$DOWNLOAD_URL" -o "$TMP_FILE"
86-
elif [ "${HAS_WGET}" == "true" ]; then
87-
wget -q -O "$TMP_FILE" "$DOWNLOAD_URL"
88-
fi
89-
}
90-
9179
installFile() {
92-
runAsRoot oras pull -o /usr/local/bin/ ghcr.io/githedgehog/fabricator/hhfab:latest
80+
runAsRoot oras pull -o /usr/local/bin/ ghcr.io/githedgehog/fabricator/hhfab:"${TAG}"
9381
runAsRoot chmod +x /usr/local/bin/hhfab
9482

9583
echo "$BINARY_NAME installed into $INSTALL_DIR/$BINARY_NAME"

0 commit comments

Comments
 (0)