wfxr.forgit/bin/git-forgit
Tim 25789d2198
Fix function call in standalone forgit (#239)
From the standalone forgit command we call the according forgit function
by replacing a '_' with '::'. Since we have more complex function names
like 'forgit::cherry:⛏️:from::branch' we have to replace ALL
instances of '_' instead of just the first one.
2022-10-04 12:47:23 +02:00

20 lines
517 B
Bash
Executable file

#!/usr/bin/env bash
# This file is a bridge between forgit and git itself. This makes forgit a
# subcommand of git, and forwards all arguments on to forgit. So, all of these
# commands will work as expected:
#
# `git forgit log`
# `git forgit checkout_file`
# `git forgit checkout_file README.md`
#
# This gives users the choice to set aliases inside of their git config instead
# of their shell config if they prefer.
set -e
source "$FORGIT_INSTALL_DIR/forgit.plugin.zsh"
cmd="$1"
shift
forgit::${cmd//_/::} "$@"