1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,21 @@ |
0 |
+function _cap_does_task_list_need_generating () { |
|
1 |
+ if [ ! -f .cap_tasks~ ]; then return 0; |
|
2 |
+ else |
|
3 |
+ accurate=$(stat -f%m .cap_tasks~) |
|
4 |
+ changed=$(stat -f%m config/deploy.rb) |
|
5 |
+ return $(expr $accurate '>=' $changed) |
|
6 |
+ fi |
|
7 |
+} |
|
8 |
+ |
|
9 |
+function _cap () { |
|
10 |
+ if [ -f config/deploy.rb ]; then |
|
11 |
+ if _cap_does_task_list_need_generating; then |
|
12 |
+ echo "\nGenerating .cap_tasks~..." > /dev/stderr |
|
13 |
+ cap show_tasks -q | cut -d " " -f 1 | sed -e '/^ *$/D' -e '1,2D' |
|
14 |
+> .cap_tasks~ |
|
15 |
+ fi |
|
16 |
+ compadd `cat .cap_tasks~` |
|
17 |
+ fi |
|
18 |
+} |
|
19 |
+ |
|
20 |
+compctl -K _cap cap |
|
0 | 21 |
\ No newline at end of file |
... | ... |
@@ -1,4 +1,3 @@ |
1 |
- |
|
2 | 1 |
alias ss='thin --stats "/thin/stats" start' |
3 | 2 |
alias sg='ruby script/generate' |
4 | 3 |
alias sd='ruby script/destroy' |
... | ... |
@@ -9,28 +8,6 @@ alias sc='ruby script/console' |
9 | 9 |
alias sd='ruby script/server --debugger' |
10 | 10 |
alias devlog='tail -f log/development.log' |
11 | 11 |
|
12 |
-function _cap_does_task_list_need_generating () { |
|
13 |
- if [ ! -f .cap_tasks~ ]; then return 0; |
|
14 |
- else |
|
15 |
- accurate=$(stat -f%m .cap_tasks~) |
|
16 |
- changed=$(stat -f%m config/deploy.rb) |
|
17 |
- return $(expr $accurate '>=' $changed) |
|
18 |
- fi |
|
19 |
-} |
|
20 |
- |
|
21 |
-function _cap () { |
|
22 |
- if [ -f config/deploy.rb ]; then |
|
23 |
- if _cap_does_task_list_need_generating; then |
|
24 |
- echo "\nGenerating .cap_tasks~..." > /dev/stderr |
|
25 |
- cap show_tasks -q | cut -d " " -f 1 | sed -e '/^ *$/D' -e '1,2D' |
|
26 |
-> .cap_tasks~ |
|
27 |
- fi |
|
28 |
- compadd `cat .cap_tasks~` |
|
29 |
- fi |
|
30 |
-} |
|
31 |
- |
|
32 |
-compctl -K _cap cap |
|
33 |
- |
|
34 | 12 |
function remote_console() { |
35 | 13 |
/usr/bin/env ssh $1 "( cd $2 && ruby script/console production )" |
36 | 14 |
} |