Permalink
Browse files

Changed phing command line parsing to fit current version and correct…

…ed stat command.
  • Loading branch information...
1 parent 8c45b73 commit 19339420b0d24568356bb0ef23b32b2a6c25b52f @slider slider committed Jan 6, 2012
Showing with 10 additions and 3 deletions.
  1. +10 −3 plugins/phing/phing.plugin.zsh
@@ -1,16 +1,23 @@
+stat -f%m . > /dev/null 2>&1
+if [ "$?" = 0 ]; then
+ stat_cmd=(stat -f%m)
+else
+ stat_cmd=(stat -L --format=%Y)
+fi
+
_phing_does_target_list_need_generating () {
if [ ! -f .phing_targets ]; then return 0;
else
- accurate=$(stat -f%m .phing_targets)
- changed=$(stat -f%m build.xml)
+ accurate=$($stat_cmd .phing_targets)
+ changed=$($stat_cmd build.xml)
return $(expr $accurate '>=' $changed)
fi
}
_phing () {
if [ -f build.xml ]; then
if _phing_does_target_list_need_generating; then
- phing -l |grep -v ":" |grep -v "^$"|grep -v "\-" > .phing_targets
+ phing -l |grep -v ":" |grep -v "^$"|grep -v "\-" | awk '{print $1}' | uniq > .phing_targets
fi
compadd `cat .phing_targets`
fi

0 comments on commit 1933942

Please sign in to comment.