From 8665cbb4eb4c1338a4ff018e304411c0cb2f3e5d Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Tue, 20 Jun 2017 18:28:19 +0700 Subject: [PATCH] Misc: Different behaviors if PREFIX is empty --- install.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 99a7baa9..1daf9901 100755 --- a/install.sh +++ b/install.sh @@ -12,10 +12,16 @@ while [[ "$1" ]]; do shift done -[[ -z "$BINDIR" ]] && BINDIR="/usr/bin" +if [[ -z "$PREFIX" ]]; then + [[ -z "$BINDIR" ]] && BINDIR="/usr/bin" + [[ -z "$ASCIIDIR" ]] && ASCIIDIR="/usr/share/neofetch/ascii/distro" + [[ -z "$MANDIR" ]] && MANDIR="/usr/share/man/man1" +else + [[ -z "$BINDIR" ]] && BINDIR="/bin" + [[ -z "$ASCIIDIR" ]] && ASCIIDIR="/share/neofetch/ascii/distro" + [[ -z "$MANDIR" ]] && MANDIR="/share/man/man1" +fi [[ -z "$CONFDIR" ]] && CONFDIR="/etc/neofetch" -[[ -z "$ASCIIDIR" ]] && ASCIIDIR="/usr/share/neofetch/ascii/distro" -[[ -z "$MANDIR" ]] && MANDIR="/usr/share/man/man1" mkdir -p "${DESTDIR}""${PREFIX}""${BINDIR}" mkdir -p "${DESTDIR}""${PREFIX}""${CONFDIR}"