Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
960c729aed | ||
|
|
5cd93328f5 |
+9
-2
@@ -2,7 +2,7 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
REPO_URL="https://git.rootiest.dev/rootiest/icon-color-tool.git"
|
REPO_URL="https://git.rootiest.dev/rootiest/icon-color-tool.git"
|
||||||
DOWNLOAD_URL="https://git.rootiest.dev/rootiest/icon-color-tool/releases/latest/download/icon-color-tool"
|
API_URL="https://git.rootiest.dev/api/v1/repos/rootiest/icon-color-tool/releases/latest"
|
||||||
INSTALL_DIR="${XDG_BIN_HOME:-$HOME/.local/bin}"
|
INSTALL_DIR="${XDG_BIN_HOME:-$HOME/.local/bin}"
|
||||||
TMP_DIR=$(mktemp -d)
|
TMP_DIR=$(mktemp -d)
|
||||||
|
|
||||||
@@ -35,9 +35,16 @@ if [ "$BUILD" -eq 1 ]; then
|
|||||||
cd - > /dev/null
|
cd - > /dev/null
|
||||||
else
|
else
|
||||||
echo "Mode: Downloading pre-built binary"
|
echo "Mode: Downloading pre-built binary"
|
||||||
|
DOWNLOAD_URL=$(curl -sL "$API_URL" | grep -o '"browser_download_url":"[^"]*"' | cut -d'"' -f4 | head -n 1)
|
||||||
|
|
||||||
|
if [ -z "$DOWNLOAD_URL" ]; then
|
||||||
|
echo "Error: Could not find latest release binary download URL."
|
||||||
|
echo "If the release doesn't exist yet, you can use the --build flag to build from source."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if ! curl -sfL "$DOWNLOAD_URL" -o "$TMP_DIR/icon-color-tool"; then
|
if ! curl -sfL "$DOWNLOAD_URL" -o "$TMP_DIR/icon-color-tool"; then
|
||||||
echo "Error: Failed to download binary from $DOWNLOAD_URL"
|
echo "Error: Failed to download binary from $DOWNLOAD_URL"
|
||||||
echo "If the release doesn't exist yet, you can use the --build flag to build from source."
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user