git: Add git-bug status toggle alias gbo
Requires bug-id to be passed and toggles the corresponding bug open or closed (`gbo <bug-id>`). Otherwise just passes through any arguments to the `git-bug bug status` command.
This commit is contained in:
parent
133910be08
commit
e523aa74b2
1 changed files with 14 additions and 4 deletions
|
@ -58,12 +58,22 @@ if [ -x "$(command -v vipe)" ] && [ -x "$(command -v jq)" ]; then
|
|||
}
|
||||
fi
|
||||
|
||||
# TODO: edit bug title
|
||||
alias gbte='git-bug bug title edit'
|
||||
|
||||
# TODO: Implement toggle function
|
||||
# grab current status and then open or close accordingly
|
||||
alias gbo='git-bug bug status close'
|
||||
# Toggles status of bug passed
|
||||
# or passes through to bug status
|
||||
gbo() {
|
||||
if git-bug bug status "$1" >/dev/null 2>/dev/null; then
|
||||
cur=$(git-bug bug status "$1")
|
||||
if [ "$cur" = "open" ]; then
|
||||
git-bug bug status close "$1"
|
||||
elif [ "$cur" = "closed" ]; then
|
||||
git-bug bug status open "$1"
|
||||
fi
|
||||
else
|
||||
git-bug bug status "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
alias gbp='git-bug push'
|
||||
alias gbl='git-bug pull'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue