From 9dec4920237c4d40955789b66dbe72fa8e62c428 Mon Sep 17 00:00:00 2001 From: Sasha Gerrand Date: Wed, 24 Apr 2013 13:05:28 +1000 Subject: [PATCH] Adds write permission test on ~/.bash_profile prior to backup attempt. Fixes #199. --- install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 0f1da39..46edcf2 100755 --- a/install.sh +++ b/install.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash BASH_IT="$HOME/.bash_it" -cp $HOME/.bash_profile $HOME/.bash_profile.bak - -echo "Your original .bash_profile has been backed up to .bash_profile.bak" +test -w $HOME/.bash_profile && + cp $HOME/.bash_profile $HOME/.bash_profile.bak && + echo "Your original .bash_profile has been backed up to .bash_profile.bak" cp $HOME/.bash_it/template/bash_profile.template.bash $HOME/.bash_profile -- 2.17.1