mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
added missing rake completion plugin back in
This commit is contained in:
parent
583c984a86
commit
0d59069136
1 changed files with 20 additions and 0 deletions
20
plugins/rake/rake.plugin.zsh
Normal file
20
plugins/rake/rake.plugin.zsh
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
function _rake_does_task_list_need_generating () {
|
||||||
|
if [ ! -f .rake_tasks ]; then return 0;
|
||||||
|
else
|
||||||
|
accurate=$(stat -f%m .rake_tasks)
|
||||||
|
changed=$(stat -f%m Rakefile)
|
||||||
|
return $(expr $accurate '>=' $changed)
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function _rake () {
|
||||||
|
if [ -f Rakefile ]; then
|
||||||
|
if _rake_does_task_list_need_generating; then
|
||||||
|
echo "\nGenerating .rake_tasks..." > /dev/stderr
|
||||||
|
rake --silent --tasks | cut -d " " -f 2 > .rake_tasks
|
||||||
|
fi
|
||||||
|
compadd `cat .rake_tasks`
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
compdef _rake rake
|
||||||
Loading…
Add table
Add a link
Reference in a new issue