From efa5593f88e552fbd3fde850b283fa43d36f481c Mon Sep 17 00:00:00 2001 From: Reza Date: Tue, 16 Aug 2011 13:54:47 -0700 Subject: [PATCH] Rename to _capistrano (completion only) --- plugins/capistrano/_capistrano | 19 +++++++++++++++++++ plugins/capistrano/capistrano.plugin.zsh | 20 -------------------- 2 files changed, 19 insertions(+), 20 deletions(-) create mode 100644 plugins/capistrano/_capistrano delete mode 100644 plugins/capistrano/capistrano.plugin.zsh diff --git a/plugins/capistrano/_capistrano b/plugins/capistrano/_capistrano new file mode 100644 index 00000000..2ae977fc --- /dev/null +++ b/plugins/capistrano/_capistrano @@ -0,0 +1,19 @@ +#compdef cap +#autoload + +_cap_does_task_list_need_generating () { + if [ ! -f .cap_tasks~ ]; then return 0; + else + accurate=$(stat -f%m .cap_tasks~) + changed=$(stat -f%m config/deploy.rb) + return $(expr $accurate '>=' $changed) + fi +} + +if [ -f config/deploy.rb ]; then + if _cap_does_task_list_need_generating; then + echo "\nGenerating .cap_tasks~..." > /dev/stderr + cap --tasks | grep '#' | cut -d " " -f 2 > .cap_tasks~ + fi + compadd `cat .cap_tasks~` +fi diff --git a/plugins/capistrano/capistrano.plugin.zsh b/plugins/capistrano/capistrano.plugin.zsh deleted file mode 100644 index a9db4381..00000000 --- a/plugins/capistrano/capistrano.plugin.zsh +++ /dev/null @@ -1,20 +0,0 @@ -function _cap_does_task_list_need_generating () { - if [ ! -f .cap_tasks~ ]; then return 0; - else - accurate=$(stat -f%m .cap_tasks~) - changed=$(stat -f%m config/deploy.rb) - return $(expr $accurate '>=' $changed) - fi -} - -function _cap () { - if [ -f config/deploy.rb ]; then - if _cap_does_task_list_need_generating; then - echo "\nGenerating .cap_tasks~..." > /dev/stderr - cap --tasks | grep '#' | cut -d " " -f 2 > .cap_tasks~ - fi - compadd `cat .cap_tasks~` - fi -} - -compdef _cap cap