Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
ef5a65b2
Commit
ef5a65b2
authored
Dec 02, 2012
by
Robby Russell
Browse files
Options
Browse Files
Download
Plain Diff
Renaming cap to capistrano
parents
56f09486
cfeb5702
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
41 deletions
+10
-41
cap.plugin.zsh
plugins/cap/cap.plugin.zsh
+0
-41
_capistrano
plugins/capistrano/_capistrano
+10
-0
No files found.
plugins/cap/cap.plugin.zsh
deleted
100644 → 0
View file @
56f09486
stat
-f
%m
.
>
/dev/null 2>&1
if
[
"
$?
"
=
0
]
;
then
stat_cmd
=(
stat
-f
%m
)
else
stat_cmd
=(
stat
-L
--format
=
%y
)
fi
# Cache filename
_cap_show_undescribed_tasks
=
0
# Cache filename
_cap_task_cache_file
=
'.cap_task_cache'
_cap_get_task_list
()
{
if
[
${
_cap_show_undescribed_tasks
}
-eq
0
]
;
then
cap
-T
|
grep
'^cap'
|
cut
-d
" "
-f
2
else
cap
-vT
|
grep
'^cap'
|
cut
-d
" "
-f
2
fi
}
_cap_does_task_list_need_generating
()
{
if
[
!
-f
${
_cap_task_cache_file
}
]
;
then return
0
;
else
accurate
=
$(
$stat_cmd
$_cap_task_cache_file
)
changed
=
$(
$stat_cmd
config/deploy.rb
)
return
$(
expr
$accurate
'>='
$changed
)
fi
}
function
_cap
()
{
if
[
-f
config/deploy.rb
]
;
then
if
_cap_does_task_list_need_generating
;
then
_cap_get_task_list
>
${
_cap_task_cache_file
}
fi
compadd
`
cat
${
_cap_task_cache_file
}
`
fi
}
compdef _cap cap
plugins/capistrano/_capistrano
0 → 100644
View file @
ef5a65b2
#compdef cap
#autoload
if [ -f config/deploy.rb ]; then
if [[ ! -f .cap_tasks~ || config/deploy.rb -nt .cap_tasks~ ]]; then
echo "\nGenerating .cap_tasks~..." > /dev/stderr
cap --tasks | grep '#' | cut -d " " -f 2 > .cap_tasks~
fi
compadd `cat .cap_tasks~`
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment