Skip to content

Commit bbf158a

Browse files
authored
revert install.sh
1 parent 1eb414d commit bbf158a

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

scripts/install.sh

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
11
#!/bin/bash
2-
3-
set -euo pipefail
2+
#
43
# allow specifying different destination directory
54
DIR="${DIR:-"$HOME/.local/bin"}"
65

7-
RELEASE="${1:-"latest"}"
6+
# map different architecture variations to the available binaries
7+
ARCH=$(uname | tr [:upper:] [:lower:])
88

99
# prepare the download URL
10-
TAG=$(curl -L -s -H 'Accept: application/json' https://github.com/denetpro/node/releases/$RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')
11-
12-
ARCH=$(uname -m)
13-
case "$ARCH" in
14-
x86_64) ARCH="amd64" ;;
15-
aarch64|arm64) ARCH="arm64" ;;
16-
*) error "Unsupported architecture: $ARCH" ;;
17-
esac
18-
19-
20-
GITHUB_FILE=$(echo "denode-$(uname -s)-$ARCH" | tr '[:upper:]' '[:lower:]')
21-
GITHUB_URL="https://github.com/denetpro/node/releases/download/${TAG}/${GITHUB_FILE}"
10+
GITHUB_LATEST_VERSION=$(curl -L -s -H 'Accept: application/json' https://github.com/denetpro/node/releases/latest | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')
11+
GITHUB_FILE="denode-$ARCH.zip"
12+
GITHUB_URL="https://github.com/denetpro/node/releases/download/${GITHUB_LATEST_VERSION}/${GITHUB_FILE}"
2213

2314
# install/update the local binary
24-
curl -L -o denode $GITHUB_URL
15+
curl -L -o denode.zip $GITHUB_URL
16+
unzip -a denode.zip && rm -rf denode.zip
17+
mkdir -p $DIR
2518
install -m 555 denode -t "$DIR"
26-
rm -f denode
2719
echo "`denode -v` successfully installed"

0 commit comments

Comments
 (0)