diff --git a/install.sh b/install.sh index 5bc4707..6b981ec 100644 --- a/install.sh +++ b/install.sh @@ -3,7 +3,7 @@ read -p "Do you want to install Qash? This will move your old .bashrc and replace it with Qash. y/N " if [[ $REPLY == 'y' ]]; then - dir=~/qash/ + dir=~/qash if [[ $# -gt 1 ]]; then dir=$1 fi @@ -24,8 +24,14 @@ if [[ $REPLY == 'y' ]]; then cp -r ./library/hooks/* $dir/hooks/ echo "Backing up old .bashrc..." - mv ~/.bashrc ~/.bashrc.old - source ./library/load.sh + i=0 + while [[ -f ~/.bashrc.bak.$i ]] + do + i=$i + 1 + done; + + mv ~/.bashrc ~/.bashrc.bak.$i + source $dir/load.sh echo "#!/bin/bash" >> ~/.bashrc echo "# Qash $QASH_VERSION" >> ~/.bashrc echo "# Installed on $(date -u +'%02d.%02m.%Y %02H:%02M:%02S')" >> ~/.bashrc