summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorMiles Whittaker <mjwhitta@gmail.com>2014-09-17 23:55:28 -0400
committerMiles Whittaker <mjwhitta@gmail.com>2014-09-17 23:55:28 -0400
commit77592825f072c2adfa65dab972ff87c673ee4425 (patch)
tree7dc799808ed99d51a19e933ffc1a4c4f8c7b41ca /install
parentce53b9b2a53624825e51d7b5ddcc373fc70ea0bd (diff)
Sometimes users prefer . instead of source
So only check for file name
Diffstat (limited to 'install')
-rwxr-xr-xinstall8
1 files changed, 6 insertions, 2 deletions
diff --git a/install b/install
index fd16ac10..a925e4d2 100755
--- a/install
+++ b/install
@@ -337,7 +337,11 @@ append_line() {
echo "Update $2:"
echo " - $1"
[ -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
echo " - Already exists (line #$line)"
else
@@ -349,7 +353,7 @@ append_line() {
echo
for shell in bash zsh; do
- append_line "source ~/.fzf.${shell}" ~/.${shell}rc
+ append_line "source ~/.fzf.${shell}" ~/.${shell}rc "~/.fzf.${shell}"
done
if [ $key_bindings -eq 0 -a $has_fish -eq 1 ]; then