mirror of
https://github.com/wfxr/forgit.git
synced 2026-09-10 07:16:23 -04:00
Add variable for forgit binary
This commit is contained in:
parent
b2d24138df
commit
0820811862
|
|
@ -1,93 +1,94 @@
|
|||
# MIT (c) Chris Apple
|
||||
|
||||
set -g FORGIT_INSTALL_DIR (dirname (dirname (status -f)))
|
||||
set -g FORGIT "$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit"
|
||||
|
||||
function forgit::log -d "git commit viewer"
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" log "$argv"
|
||||
"$FORGIT" log "$argv"
|
||||
end
|
||||
|
||||
function forgit::diff -d "git diff viewer" --argument-names arg1 arg2
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" diff "$argv"
|
||||
"$FORGIT" diff "$argv"
|
||||
end
|
||||
|
||||
function forgit::add -d "git add selector" --wraps "git add"
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" add "$argv"
|
||||
"$FORGIT" add "$argv"
|
||||
end
|
||||
|
||||
function forgit::reset::head -d "git reset HEAD (unstage) selector"
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" reset_head "$argv"
|
||||
"$FORGIT" reset_head "$argv"
|
||||
end
|
||||
|
||||
function forgit::stash::show -d "git stash viewer"
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" stash_show "$argv"
|
||||
"$FORGIT" stash_show "$argv"
|
||||
end
|
||||
|
||||
function forgit::clean -d "git clean selector"
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" clean "$argv"
|
||||
"$FORGIT" clean "$argv"
|
||||
end
|
||||
|
||||
function forgit::cherry::pick -d "git cherry-picking" --argument-names 'target' --wraps "git cherry-pick"
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" cherry_pick "$argv"
|
||||
"$FORGIT" cherry_pick "$argv"
|
||||
end
|
||||
|
||||
function forgit::cherry::pick::from::branch -d "git cherry-picking with interactive branch selection"
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" cherry_pick_from_branch "$argv"
|
||||
"$FORGIT" cherry_pick_from_branch "$argv"
|
||||
end
|
||||
|
||||
function forgit::rebase -d "git rebase"
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" rebase "$argv"
|
||||
"$FORGIT" rebase "$argv"
|
||||
end
|
||||
|
||||
function forgit::fixup -d "git fixup"
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" fixup "$argv"
|
||||
"$FORGIT" fixup "$argv"
|
||||
end
|
||||
|
||||
function forgit::checkout::file -d "git checkout-file selector" --argument-names 'file_name' --wraps "git checkout --"
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" checkout_file "$argv"
|
||||
"$FORGIT" checkout_file "$argv"
|
||||
end
|
||||
|
||||
function forgit::checkout::branch -d "git checkout branch selector" --argument-names 'input_branch_name' --wraps "git branch"
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" checkout_branch "$argv"
|
||||
"$FORGIT" checkout_branch "$argv"
|
||||
end
|
||||
|
||||
function forgit::checkout::tag -d "git checkout tag selector" --argument-names 'tag_name' --wraps "git checkout"
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" checkout_tag "$argv"
|
||||
"$FORGIT" checkout_tag "$argv"
|
||||
end
|
||||
|
||||
function forgit::checkout::commit -d "git checkout commit selector" --argument-names 'commit_id' --wraps "git checkout"
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" checkout_commit "$argv"
|
||||
"$FORGIT" checkout_commit "$argv"
|
||||
end
|
||||
|
||||
function forgit::branch::delete -d "git checkout branch deleter" --wraps "git branch --delete"
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" branch_delete "$argv"
|
||||
"$FORGIT" branch_delete "$argv"
|
||||
end
|
||||
|
||||
function forgit::revert::commit --argument-names 'commit_hash' --wraps "git revert --"
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" revert_commit "$argv"
|
||||
"$FORGIT" revert_commit "$argv"
|
||||
end
|
||||
|
||||
function forgit::blame
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" blame "$argv"
|
||||
"$FORGIT" blame "$argv"
|
||||
end
|
||||
|
||||
function forgit::ignore -d "git ignore generator"
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" ignore "$argv"
|
||||
"$FORGIT" ignore "$argv"
|
||||
end
|
||||
|
||||
function forgit::ignore::update
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" ignore_update "$argv"
|
||||
"$FORGIT" ignore_update "$argv"
|
||||
end
|
||||
|
||||
function forgit::ignore::get
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" ignore_get "$argv"
|
||||
"$FORGIT" ignore_get "$argv"
|
||||
end
|
||||
|
||||
function forgit::ignore::list
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" ignore_list "$argv"
|
||||
"$FORGIT" ignore_list "$argv"
|
||||
end
|
||||
|
||||
function forgit::ignore::clean
|
||||
"$FORGIT_INSTALL_DIR/conf.d/bin/git-forgit" ignore_clean "$argv"
|
||||
"$FORGIT" ignore_clean "$argv"
|
||||
end
|
||||
|
||||
# register aliases
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
forgit::error() { printf "%b[Error]%b %s\n" '\e[0;31m' '\e[0m' "$@" >&2; return 1; }
|
||||
|
||||
# set installation path
|
||||
# determine installation path
|
||||
if [[ -n "$ZSH_VERSION" ]]; then
|
||||
# shellcheck disable=2277,2296,2299
|
||||
0="${ZERO:-${${0:#$ZSH_ARGZERO}:-${(%):-%N}}}"
|
||||
|
|
@ -15,95 +15,95 @@ elif [[ -n "$BASH_VERSION" ]]; then
|
|||
else
|
||||
forgit::error "Only zsh and bash are supported"
|
||||
fi
|
||||
export FORGIT_INSTALL_DIR
|
||||
export FORGIT="$FORGIT_INSTALL_DIR/bin/git-forgit"
|
||||
|
||||
# register shell functions
|
||||
forgit::log() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" log "$@"
|
||||
"$FORGIT" log "$@"
|
||||
}
|
||||
|
||||
forgit::diff() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" diff "$@"
|
||||
"$FORGIT" diff "$@"
|
||||
}
|
||||
|
||||
forgit::add() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" add "$@"
|
||||
"$FORGIT" add "$@"
|
||||
}
|
||||
|
||||
forgit::reset::head() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" reset_head "$@"
|
||||
"$FORGIT" reset_head "$@"
|
||||
}
|
||||
|
||||
forgit::stash::show() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" stash_show "$@"
|
||||
"$FORGIT" stash_show "$@"
|
||||
}
|
||||
|
||||
forgit::clean() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" clean "$@"
|
||||
"$FORGIT" clean "$@"
|
||||
}
|
||||
|
||||
forgit::cherry::pick() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" cherry_pick "$@"
|
||||
"$FORGIT" cherry_pick "$@"
|
||||
}
|
||||
|
||||
forgit::cherry::pick::from::branch() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" cherry_pick_from_branch "$@"
|
||||
"$FORGIT" cherry_pick_from_branch "$@"
|
||||
}
|
||||
|
||||
forgit::rebase() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" rebase "$@"
|
||||
"$FORGIT" rebase "$@"
|
||||
}
|
||||
|
||||
forgit::fixup() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" fixup "$@"
|
||||
"$FORGIT" fixup "$@"
|
||||
}
|
||||
|
||||
forgit::checkout::file() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" checkout_file "$@"
|
||||
"$FORGIT" checkout_file "$@"
|
||||
}
|
||||
|
||||
forgit::checkout::branch() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" checkout_branch "$@"
|
||||
"$FORGIT" checkout_branch "$@"
|
||||
}
|
||||
|
||||
forgit::checkout::tag() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" checkout_tag "$@"
|
||||
"$FORGIT" checkout_tag "$@"
|
||||
}
|
||||
|
||||
forgit::checkout::commit() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" checkout_commit "$@"
|
||||
"$FORGIT" checkout_commit "$@"
|
||||
}
|
||||
|
||||
forgit::branch::delete() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" branch_delete "$@"
|
||||
"$FORGIT" branch_delete "$@"
|
||||
}
|
||||
|
||||
forgit::revert::commit() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" revert_commit "$@"
|
||||
"$FORGIT" revert_commit "$@"
|
||||
}
|
||||
|
||||
forgit::blame() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" blame "$@"
|
||||
"$FORGIT" blame "$@"
|
||||
}
|
||||
|
||||
forgit::ignore() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" ignore "$@"
|
||||
"$FORGIT" ignore "$@"
|
||||
}
|
||||
|
||||
forgit::ignore::update() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" ignore_update "$@"
|
||||
"$FORGIT" ignore_update "$@"
|
||||
}
|
||||
|
||||
forgit::ignore::get() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" ignore_get "$@"
|
||||
"$FORGIT" ignore_get "$@"
|
||||
}
|
||||
|
||||
forgit::ignore::list() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" ignore_list "$@"
|
||||
"$FORGIT" ignore_list "$@"
|
||||
}
|
||||
|
||||
forgit::ignore::clean() {
|
||||
"$FORGIT_INSTALL_DIR/bin/git-forgit" ignore_clean "$@"
|
||||
"$FORGIT" ignore_clean "$@"
|
||||
}
|
||||
|
||||
# register aliases
|
||||
|
|
|
|||
Loading…
Reference in a new issue