| ... | ... |
@@ -7,4 +7,26 @@ alias ssp='ruby script/spec' |
| 7 | 7 |
alias rdbm='rake db:migrate' |
| 8 | 8 |
alias sc='ruby script/console' |
| 9 | 9 |
alias sd='ruby script/server --debugger' |
| 10 |
-alias devlog='tail -f log/development.log' |
|
| 11 | 10 |
\ No newline at end of file |
| 11 |
+alias devlog='tail -f log/development.log' |
|
| 12 |
+ |
|
| 13 |
+function _cap_does_task_list_need_generating () {
|
|
| 14 |
+ if [ ! -f .cap_tasks~ ]; then return 0; |
|
| 15 |
+ else |
|
| 16 |
+ accurate=$(stat -f%m .cap_tasks~) |
|
| 17 |
+ changed=$(stat -f%m config/deploy.rb) |
|
| 18 |
+ return $(expr $accurate '>=' $changed) |
|
| 19 |
+ fi |
|
| 20 |
+} |
|
| 21 |
+ |
|
| 22 |
+function _cap () {
|
|
| 23 |
+ if [ -f config/deploy.rb ]; then |
|
| 24 |
+ if _cap_does_task_list_need_generating; then |
|
| 25 |
+ echo "\nGenerating .cap_tasks~..." > /dev/stderr |
|
| 26 |
+ cap show_tasks -q | cut -d " " -f 1 | sed -e '/^ *$/D' -e '1,2D' |
|
| 27 |
+> .cap_tasks~ |
|
| 28 |
+ fi |
|
| 29 |
+ compadd `cat .cap_tasks~` |
|
| 30 |
+ fi |
|
| 31 |
+} |
|
| 32 |
+ |
|
| 33 |
+compctl -K _cap cap |