Fix shellcheck warnings
[config/vcsh.git] / .config / vcsh / hooks-available / sparse-checkout.sh
1 #!/bin/sh
2
3 set -e
4
5 # If the vcsh repository does not exist, exit without doing anything.
6 [ -d "$GIT_DIR" ] || exit 0
7
8 : "${XDG_CONFIG_HOME:="$HOME/.config"}"
9
10 git config core.sparseCheckout true
11 rm -f "$GIT_DIR/info/sparse-checkout"
12 ln -s "$XDG_CONFIG_HOME/vcsh/sparse-checkout" "$GIT_DIR/info/sparse-checkout"