Update install script

This commit is contained in:
Junegunn Choi 2014-03-31 00:53:35 +09:00
parent 52b74abb99
commit 48f9ee6763
1 changed files with 5 additions and 2 deletions

View File

@ -238,8 +238,9 @@ for shell in bash zsh; do
echo "Update $rc:"
echo " - $src"
if [ $(grep -F "$src" $rc | wc -l) -gt 0 ]; then
echo " - Not added (already being sourced)"
line=$(grep -nF "$src" $rc | sed 's/:.*//')
if [ -n "$line" ]; then
echo " - Already exists (line #$line)"
else
echo $src >> $rc
echo " - Added"
@ -253,5 +254,7 @@ Finished. Reload your .bashrc or .zshrc.
source ~/.zshrc # zsh
To uninstall fzf, simply remove the added line.
For more information, see: https://github.com/junegunn/fzf
EOF