Skip to content

Commit

Permalink
squash later
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Herdiansyah committed Jul 10, 2017
1 parent c65c14f commit c340fc3
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,28 @@ while [ "$1" ]; do
shift
done

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 "$BINDIR" ] && BINDIR="/bin"
[ -z "$ASCIIDIR" ] && ASCIIDIR="/share/neofetch/ascii/distro"
[ -z "$MANDIR" ] && MANDIR="/share/man/man1"
[ -z "$CONFDIR" ] && CONFDIR="/etc/neofetch"

mkdir -p "${DESTDIR}""${PREFIX}""${BINDIR}"
mkdir -p "${DESTDIR}""${PREFIX}""${CONFDIR}"
mkdir -p "${DESTDIR}""${PREFIX}""${ASCIIDIR}"
mkdir -p "${DESTDIR}""${PREFIX}""${MANDIR}"

sed -i -e "s|CONFDIR|${PREFIX}${CONFDIR}|g" neofetch
sed -i -e "s|ASCIIDIR|${PREFIX}${ASCIIDIR}|g" neofetch

cp -p neofetch "${DESTDIR}""${PREFIX}""${BINDIR}"
cp -p config/config.conf "${DESTDIR}""${PREFIX}""${CONFDIR}"
cp -p ascii/distro/* "${DESTDIR}""${PREFIX}""${ASCIIDIR}"
cp -p neofetch.1 "${DESTDIR}""${PREFIX}""${MANDIR}"

if [ -z "$PREFIX" ] || [ "$PREFIX" = "/usr" ]; then
mkdir -p "${DESTDIR}""${CONFDIR}"
sed -i -e "s|CONFDIR|${CONFDIR}|g" neofetch
cp -p config/config.conf "${DESTDIR}""${CONFDIR}"
else
mkdir -p "${DESTDIR}""${PREFIX}""${CONFDIR}"
sed -i -e "s|CONFDIR|${PREFIX}${CONFDIR}|g" neofetch
cp -p config/config.conf "${DESTDIR}""${PREFIX}""${CONFDIR}"
fi

0 comments on commit c340fc3

Please sign in to comment.