Sometimes users prefer . instead of source

So only check for file name
This commit is contained in:
Miles Whittaker 2014-09-17 23:55:28 -04:00
parent ce53b9b2a5
commit 77592825f0

View File

@ -337,7 +337,11 @@ append_line() {
echo "Update $2:" echo "Update $2:"
echo " - $1" echo " - $1"
[ -f "$2" ] || touch "$2" [ -f "$2" ] || touch "$2"
line=$(\grep -nF "$1" "$2" | sed 's/:.*//') if [ $# -lt 3 ]; then
line=$(\grep -nF "$1" "$2" | sed 's/:.*//')
else
line=$(\grep -nF "$3" "$2" | sed 's/:.*//')
fi
if [ -n "$line" ]; then if [ -n "$line" ]; then
echo " - Already exists (line #$line)" echo " - Already exists (line #$line)"
else else
@ -349,7 +353,7 @@ append_line() {
echo echo
for shell in bash zsh; do for shell in bash zsh; do
append_line "source ~/.fzf.${shell}" ~/.${shell}rc append_line "source ~/.fzf.${shell}" ~/.${shell}rc "~/.fzf.${shell}"
done done
if [ $key_bindings -eq 0 -a $has_fish -eq 1 ]; then if [ $key_bindings -eq 0 -a $has_fish -eq 1 ]; then