From 5d352ae0941b02f12b1326d1d85686da26c36c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Sat, 8 May 2021 22:52:43 +0200 Subject: [PATCH] fix install.sh bin name --- install.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index b7ccc73..d6e72e5 100644 --- a/install.sh +++ b/install.sh @@ -7,16 +7,15 @@ die() { exit "${2-1}" } -DESTDIR="${DESTDIR:-/}" +DESTDIR="${DESTDIR:-}" PREFIX="${PREFIX:-"$DESTDIR/usr/local"}" RELEASES_URL="https://github.com/soywod/himalaya/releases" system=$(uname -s | tr [:upper:] [:lower:]) - case $system in - msys*|mingw*|cygwin*|win*) system=windows;; - linux|freebsd) system=linux;; - darwin) system=macos;; + msys*|mingw*|cygwin*|win*) system=windows; binary=himalaya.exe;; + linux|freebsd) system=linux; binary=himalaya;; + darwin) system=macos; binary=himalaya;; *) die "Unsupported system: $system" ;; esac @@ -31,6 +30,6 @@ echo "Installing binary…" tar -xzf "$tmpdir/himalaya.tar.gz" -C "$tmpdir" mkdir -p "$PREFIX/bin" -cp -f -- "$tmpdir/himalaya*" "$PREFIX/bin/" +cp -f -- "$tmpdir/$binary" "$PREFIX/bin/$binary" -die "$("$PREFIX/bin/himalaya" --version) installed!" 0 +die "$("$PREFIX/bin/$binary" --version) installed!" 0