diff options
author | Jake Bell <jake.b.bell@gmail.com> | 2010-10-01 14:15:52 -0500 |
---|---|---|
committer | Jake Bell <jake.b.bell@gmail.com> | 2010-10-01 14:15:52 -0500 |
commit | 541da0c9d1cdf88583490fa06b6e307ea09bfc94 (patch) | |
tree | 55228162496e7c88adc8d8c84f865c4ee153c3c6 /plugins/cap/cap.plugin.zsh | |
parent | a4afcfddbf8c9e8769e4e78c23a144c9b3c9aaf3 (diff) | |
download | zsh-541da0c9d1cdf88583490fa06b6e307ea09bfc94.tar.gz zsh-541da0c9d1cdf88583490fa06b6e307ea09bfc94.tar.bz2 zsh-541da0c9d1cdf88583490fa06b6e307ea09bfc94.zip |
Removing capistrano aliases/functions from rails plugin (since cap is not rails-specific).
Diffstat (limited to 'plugins/cap/cap.plugin.zsh')
-rw-r--r-- | plugins/cap/cap.plugin.zsh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/cap/cap.plugin.zsh b/plugins/cap/cap.plugin.zsh new file mode 100644 index 000000000..a0fa21d00 --- /dev/null +++ b/plugins/cap/cap.plugin.zsh @@ -0,0 +1,21 @@ +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 show_tasks -q | cut -d " " -f 1 | sed -e '/^ *$/D' -e '1,2D' +> .cap_tasks~ + fi + compadd `cat .cap_tasks~` + fi +} + +compctl -K _cap cap
\ No newline at end of file |