phing.plugin.zsh 458 B

12345678910111213141516171819
  1. _phing_does_target_list_need_generating () {
  2. if [ ! -f .phing_targets ]; then return 0;
  3. else
  4. accurate=$(stat -f%m .phing_targets)
  5. changed=$(stat -f%m build.xml)
  6. return $(expr $accurate '>=' $changed)
  7. fi
  8. }
  9. _phing () {
  10. if [ -f build.xml ]; then
  11. if _phing_does_target_list_need_generating; then
  12. phing -l |grep -v ":" |grep -v "^$"|grep -v "\-" > .phing_targets
  13. fi
  14. compadd `cat .phing_targets`
  15. fi
  16. }
  17. compdef _phing phing