-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
30 lines (27 loc) · 794 Bytes
/
install.sh
File metadata and controls
30 lines (27 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
# Install script for yarn-completion
set -e
SHELL_TYPE="${1:-bash}"
case "$SHELL_TYPE" in
bash)
DEST="${HOME}/.local/share/bash-completion/completions"
mkdir -p "$DEST"
cp completions/yarn "$DEST/yarn"
echo "Installed bash completion to $DEST/yarn"
echo "Add this to your ~/.bashrc:"
echo " source $DEST/yarn"
;;
zsh)
DEST="${HOME}/.zsh/completions"
mkdir -p "$DEST"
cp completions/_yarn "$DEST/_yarn"
echo "Installed zsh completion to $DEST/_yarn"
echo "Add this to your ~/.zshrc:"
echo " fpath=($DEST \$fpath)"
echo " autoload -U compinit && compinit"
;;
*)
echo "Usage: ./install.sh [bash|zsh]"
exit 1
;;
esac