Git-native issue tracking tool
git issue
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960#!/usr/bin/env sh# shellcheck disable=SC2016if [ ! -f "git-pad" ] || { [ ! -f "autocompletion.bash" ] && [ ! -f "autocompletion.zsh" ] && [ ! -f "autocompletion.fish" ]; } ; then echo '!E: Not in git-pad directory'; exit 1fi
if [ $# -eq 0 ]; then # On Windows/Git Bash, $SHELL may be unset or a Windows path # so detect the shell via version variables instead if [ -n "${ZSH_VERSION:-}" ]; then exec /usr/bin/env sh $0 zsh; elif [ -n "${BASH_VERSION:-}" ]; then exec /usr/bin/env sh $0 bash; else exec /usr/bin/env sh $0 "$(basename "${SHELL:-unknown}")"; fielse shell_name=$1fi
# On Windows, $HOME may be unsetif [ -z "${HOME:-}" ]; then HOME="$(cd ~ && pwd)"fi
# Start the validation and installationid="## git-pad"
case "$shell_name" in bash | zsh) rc="$HOME/.${shell_name}rc"
block=''"$id"'PATH=$PATH:'"$PWD"'export PATH. '"$PWD"'/autocompletion.'"$shell_name" ;;
fish) ln -s "$PWD/autocompletion.fish" "$HOME/.config/fish/completions/git-pad.fish" rc="$HOME/.config/fish/config.fish"
block=''"$id"'fish_add_path '"$PWD" ;;
*) echo "Unsupported shell: $shell_name"; exit 1 ;;esac
if grep -q "$id" "$rc" 2>/dev/null; then echo '!W: Looks like it is already installed' echo '--------------------------------------' grep -C 5 "$id" "$rc"else echo "$block" >> "$rc" && echo "Installed successfully. Restart your shell."fi