summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2018-09-27 10:15:22 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2018-09-27 10:15:22 +0900
commit8e34e6fbb48b819b8aeff19f8ea95fac269ebe55 (patch)
treeed60d3b9996dac0e670abcffa453c4608d7b74aa /install
parent3bc98ed623d3bde84e91d5f3bfb4f3af5e18556d (diff)
[install] Escape spaces in installation directory
Close #1390
Diffstat (limited to 'install')
-rwxr-xr-xinstall9
1 files changed, 5 insertions, 4 deletions
diff --git a/install b/install
index 2af381f0..ec417929 100755
--- a/install
+++ b/install
@@ -73,7 +73,8 @@ for opt in "$@"; do
done
cd "$(dirname "${BASH_SOURCE[0]}")"
-fzf_base="$(pwd)"
+fzf_base=$(pwd)
+fzf_base_esc=$(printf %q "$fzf_base")
ask() {
while true; do
@@ -267,7 +268,7 @@ for shell in $shells; do
cat > "$src" << EOF
# Setup fzf
# ---------
-if [[ ! "\$PATH" == *$fzf_base/bin* ]]; then
+if [[ ! "\$PATH" == *$fzf_base_esc/bin* ]]; then
export PATH="\$PATH:$fzf_base/bin"
fi
@@ -287,8 +288,8 @@ done
if [[ "$shells" =~ fish ]]; then
echo -n "Update fish_user_paths ... "
fish << EOF
- echo \$fish_user_paths | \grep $fzf_base/bin > /dev/null
- or set --universal fish_user_paths \$fish_user_paths $fzf_base/bin
+ echo \$fish_user_paths | \grep "$fzf_base"/bin > /dev/null
+ or set --universal fish_user_paths \$fish_user_paths "$fzf_base"/bin
EOF
[ $? -eq 0 ] && echo "OK" || echo "Failed"