Skip to content

Commit cd35d20

Browse files
author
mkyla
authored
Fix download_binary to include version number in URL
Updated download_binary function to use version number in the download URL.
1 parent a6c9ac1 commit cd35d20

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

np.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ need_root() { [ "$(id -u)" -eq 0 ] || die "root required"; }
1010
get_latest_version() { curl -fsSL "https://api.github.com/repos/$REPO/releases/latest" | grep '"tag_name"' | cut -d'"' -f4; }
1111
get_arch() { case "$(uname -m)" in x86_64) echo amd64;; aarch64|arm64) echo arm64;; *) die "unsupported arch: $(uname -m)";; esac; }
1212
download_binary() {
13-
local ver=$(get_latest_version) arch=$(get_arch) os=$(uname -s | tr '[:upper:]' '[:lower:]')
13+
local ver=$(get_latest_version) ver_num=${ver#v} arch=$(get_arch) os=$(uname -s | tr '[:upper:]' '[:lower:]')
1414
echo "Downloading nodepass $ver ..."
15-
curl -fsSL "https://github.com/$REPO/releases/download/$ver/nodepass_${os}_${arch}.tar.gz" -o /tmp/nodepass.tar.gz
15+
curl -fsSL "https://github.com/$REPO/releases/download/$ver/nodepass_${ver_num}_${os}_${arch}.tar.gz" -o /tmp/nodepass.tar.gz
1616
tar -xzf /tmp/nodepass.tar.gz -C "$(dirname "$BIN")" && chmod +x "$BIN" && rm -f /tmp/nodepass.tar.gz
1717
}
1818
install_service() {

0 commit comments

Comments
 (0)