forked from sorin-ionescu/prezto
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removing capistrano aliases/functions from rails plugin (since cap is…
… not rails-specific).
- Loading branch information
Showing
2 changed files
with
21 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters