Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Changed phing command line parsing to fit current version and corrected ... #813

Closed
wants to merge 1 commit into from

4 participants

@slider

...the stat command.

@clippit

+1 For this pull request.
stat command is different between Linux and OS X. Before the patch, phing auto-completion shows the following errors stat: invalid option -- '%' error on my CentOS. See #19 for reference.

@nubs

Ah, I did not see this pull request when I created #1655. I'll leave mine open for now as it has some differences from this one, but :+1: on this change needing to be incorporated.

@robbyrussell

#1655 was merged already -- so closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 6, 2012
  1. @slider
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 3 deletions.
  1. +10 −3 plugins/phing/phing.plugin.zsh
View
13 plugins/phing/phing.plugin.zsh
@@ -1,8 +1,15 @@
+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
}
@@ -10,7 +17,7 @@ _phing_does_target_list_need_generating () {
_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
Something went wrong with that request. Please try again.