aboutsummaryrefslogtreecommitdiffstats
path: root/install.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xinstall.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/install.sh b/install.sh
index 872118c..37a7021 100755
--- a/install.sh
+++ b/install.sh
@@ -28,28 +28,27 @@ fi
28 28
29echo "" 29echo ""
30echo "Installing shell completions..." 30echo "Installing shell completions..."
31SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
32shell_name=$(basename "${SHELL:-}") 31shell_name=$(basename "${SHELL:-}")
33case "$shell_name" in 32case "$shell_name" in
34 bash) 33 bash)
35 dest="${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion/completions" 34 dest="${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion/completions"
36 mkdir -p "$dest" 35 mkdir -p "$dest"
37 cp "$SCRIPT_DIR/completions/rsp.bash" "$dest/rsp" 36 /usr/bin/rsp completions bash > "$dest/rsp"
38 echo " → Bash completions: $dest/rsp" 37 echo " → Bash completions: $dest/rsp"
39 ;; 38 ;;
40 zsh) 39 zsh)
41 dest="/usr/share/zsh/site-functions/_rsp" 40 dest="/usr/share/zsh/site-functions/_rsp"
42 sudo cp "$SCRIPT_DIR/completions/rsp.zsh" "$dest" 41 /usr/bin/rsp completions zsh | sudo tee "$dest" > /dev/null
43 echo " → Zsh completions: $dest" 42 echo " → Zsh completions: $dest"
44 ;; 43 ;;
45 fish) 44 fish)
46 dest="$HOME/.config/fish/completions/rsp.fish" 45 dest="$HOME/.config/fish/completions/rsp.fish"
47 mkdir -p "$(dirname "$dest")" 46 mkdir -p "$(dirname "$dest")"
48 cp "$SCRIPT_DIR/completions/rsp.fish" "$dest" 47 /usr/bin/rsp completions fish > "$dest"
49 echo " → Fish completions: $dest" 48 echo " → Fish completions: $dest"
50 ;; 49 ;;
51 *) 50 *)
52 echo " → Unrecognized shell '$shell_name'; completion files are in $SCRIPT_DIR/completions/" 51 echo " → Unrecognized shell '$shell_name'; generate with: rsp completions <bash|zsh|fish|powershell|elvish>"
53 ;; 52 ;;
54esac 53esac
55 54