mirror of
https://github.com/wfxr/forgit.git
synced 2026-09-10 23:36:20 -04:00
add handling for standalone version of forgit (for use in git commands)
This commit is contained in:
parent
8107352941
commit
896aaa44a4
8
bin/git-forgit
Executable file
8
bin/git-forgit
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
source "$FORGIT_INSTALL_DIR/forgit.plugin.zsh"
|
||||
|
||||
cmd="$1"
|
||||
shift
|
||||
forgit::${cmd/-/::} "$@"
|
||||
|
|
@ -333,3 +333,18 @@ if [[ -z "$FORGIT_NO_ALIASES" ]]; then
|
|||
alias "${forgit_rebase:-grb}"='forgit::rebase'
|
||||
alias "${forgit_fixup:-gfu}"='forgit::fixup'
|
||||
fi
|
||||
|
||||
if [[ -n "$FORGIT_STANDALONE" ]]; then
|
||||
if [[ -n "$ZSH_VERSION" ]]; then
|
||||
FORGIT_INSTALL_DIR="$( dirname -- "$0")"
|
||||
elif [[ -n "$BASH_VERSION" ]]; then
|
||||
FORGIT_INSTALL_DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
||||
else
|
||||
forgit::warn "Shell not supported for FORGIT_STANDLONE (only zsh and bash)"
|
||||
fi
|
||||
|
||||
if [[ -n "$FORGIT_INSTALL_DIR" ]]; then
|
||||
export FORGIT_INSTALL_DIR
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue