1
0
mirror of https://github.com/coalaura/up.git synced 2025-07-17 21:44:35 +00:00
This commit is contained in:
Laura
2025-06-21 00:37:15 +02:00
parent a9dc53df22
commit 69d25a313a

View File

@ -30,21 +30,22 @@ if ! printf '%s\n' "$VERSION" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+$'; then
fi
BIN="up_${VERSION}_${OS}_${ARCH}"
URL="https://github.com/coalaura/up/releases/download/${VERSION}/${BIN}"
echo "Downloading ${BIN}..."
if ! curl -sL "https://github.com/coalaura/up/releases/download/${VERSION}/${BIN}" -o up; then
if ! curl -sL "$URL" -o /tmp/up; then
echo "Error: failed to download $URL" >&2
exit 1
fi
trap 'rm -f ./up' EXIT
trap 'rm -f /tmp/up' EXIT
chmod +x up
chmod +x /tmp/up
echo "Installing to /usr/local/bin/up requires sudo"
if ! sudo install -m755 up /usr/local/bin/up; then
if ! sudo install -m755 /tmp/up /usr/local/bin/up; then
echo "Error: install failed" >&2
exit 1
fi