X-Git-Url: https://src.twobees.de/?a=blobdiff_plain;f=stow%2Foh-my-zsh%2F.oh-my-zsh%2Fplugins%2Fcapistrano%2F_capistrano;fp=stow%2Foh-my-zsh%2F.oh-my-zsh%2Fplugins%2Fcapistrano%2F_capistrano;h=0000000000000000000000000000000000000000;hb=1a8e170bbe5c6641a26ab1ce2e6ce6c5c1faa4cd;hp=a79e47b2fa2ef75574e73017197c242932cc717d;hpb=475ba35502579302593f4735c853c49ef1845dcb;p=dotfiles.git diff --git a/stow/oh-my-zsh/.oh-my-zsh/plugins/capistrano/_capistrano b/stow/oh-my-zsh/.oh-my-zsh/plugins/capistrano/_capistrano deleted file mode 100644 index a79e47b..0000000 --- a/stow/oh-my-zsh/.oh-my-zsh/plugins/capistrano/_capistrano +++ /dev/null @@ -1,49 +0,0 @@ -#compdef capit -#autoload - -# Added `capit` because `cap` is a reserved word. `cap` completion doesn't work. -# http://zsh.sourceforge.net/Doc/Release/Zsh-Modules.html#The-zsh_002fcap-Module - -local curcontext="$curcontext" state line ret=1 -local -a _configs - -_arguments -C \ - '1: :->cmds' \ - '2:: :->args' && ret=0 - -_cap_tasks() { - if [[ -f config/deploy.rb || -f Capfile ]]; then - if [[ ! -f .cap_tasks~ ]]; then - capit --tasks | sed 's/\(\[\)\(.*\)\(\]\)/\2:/' | awk '{command=$2; $1=$2=$3=""; gsub(/^[ \t\r\n]+/, "", $0); gsub(":", "\\:", command); print command"["$0"]"}' > .cap_tasks~ - fi - - OLD_IFS=$IFS - IFS=$'\n' - _values 'cap commands' $(< .cap_tasks~) - IFS=$OLD_IFS - # zmodload zsh/mapfile - # _values ${(f)mapfile[.cap_tasks~]} - fi -} - -_cap_stages() { - compadd $(find config/deploy -name \*.rb | cut -d/ -f3 | sed s:.rb::g) -} - -case $state in - cmds) - # check if it uses multistage - if [[ -d config/deploy ]]; then - _cap_stages - else - _cap_tasks - fi - ret=0 - ;; - args) - _cap_tasks - ret=0 - ;; -esac - -return ret