fix install.sh bin name

This commit is contained in:
Clément DOUIN 2021-05-08 22:52:43 +02:00
parent f6b2fa76b7
commit 5d352ae094
No known key found for this signature in database
GPG key ID: 69C9B9CFFDEE2DEF

View file

@ -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