Switching branches often makes the rake completion somewhat less usable. So I changed it up a bit to use the md5 sums of all the rake files instead of looking at timestamps:
zsh
#compdef rake
if [[ -f Rakefile ]]; then
sum=`md5 -q Rakefile **/*.rake | md5`
if [[ ! -f .rake_tasks.$sum~ ]]; then
rake -s --tasks | cut -d ' ' -f 2 > .rake_tasks.$sum~
fi
compadd $(cat .rake_tasks.$sum~)
fi
This will leave a bunch of .rake_tasks.[...]~ files around so the fast completion will continue to work even when switching between branches that have different rake files.
Switching branches often makes the rake completion somewhat less usable. So I changed it up a bit to use the md5 sums of all the rake files instead of looking at timestamps:
This will leave a bunch of .rake_tasks.[...]~ files around so the fast completion will continue to work even when switching between branches that have different rake files.