mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-02-13 04:40:59 +01:00
feat(jira-auto-worklog): Add jira-auto-worklog plugin
This commit is contained in:
20
plugins/jira-auto-worklog/jira-auto-worklog.plugin.zsh
Normal file
20
plugins/jira-auto-worklog/jira-auto-worklog.plugin.zsh
Normal file
@@ -0,0 +1,20 @@
|
||||
# zle-line-init widget (don't redefine if already defined)
|
||||
(( ! ${+functions[_jira-auto-worklog_zle-line-init]} )) || return 0
|
||||
|
||||
# Get the directory of this file
|
||||
dir="$(dirname "$0")"
|
||||
|
||||
case "$widgets[zle-line-init]" in
|
||||
# Simply define the function if zle-line-init doesn't yet exist
|
||||
builtin|"") function _jira-auto-worklog_zle-line-init() {
|
||||
($dir/jira-auto-worklog &> /dev/null)
|
||||
} ;;
|
||||
# Override the current zle-line-init widget, calling the old one
|
||||
user:*) zle -N _jira-auto-worklog_orig_zle-line-init "${widgets[zle-line-init]#user:}"
|
||||
function _jira-auto-worklog_zle-line-init() {
|
||||
($dir/jira-auto-worklog &> /dev/null)
|
||||
zle _jira-auto-worklog_orig_zle-line-init -- "$@"
|
||||
} ;;
|
||||
esac
|
||||
|
||||
zle -N zle-line-init _jira-auto-worklog_zle-line-init
|
||||
Reference in New Issue
Block a user