summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobby Russell <robby@planetargon.com>2011-05-29 03:54:40 -0700
committerRobby Russell <robby@planetargon.com>2011-05-29 03:54:40 -0700
commitd708f5ddc1410a3adaa4d9aab025f1abf5054c9c (patch)
treee897c51abf2224a608374827b24184dbf02284a3
parent40a737ee1362d7d745313c4aa8ea29e28ff52978 (diff)
parent04573324d52aaadf947f3a80190e4f54d8580932 (diff)
downloadzsh-d708f5ddc1410a3adaa4d9aab025f1abf5054c9c.tar.gz
zsh-d708f5ddc1410a3adaa4d9aab025f1abf5054c9c.tar.bz2
zsh-d708f5ddc1410a3adaa4d9aab025f1abf5054c9c.zip
Merge pull request #363 from Blattlaus/master
Ant plugin: stat command doesn't work under linux
-rw-r--r--plugins/ant/ant.plugin.zsh11
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/ant/ant.plugin.zsh b/plugins/ant/ant.plugin.zsh
index 0544ac92c..23bc7756a 100644
--- a/plugins/ant/ant.plugin.zsh
+++ b/plugins/ant/ant.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
+
_ant_does_target_list_need_generating () {
if [ ! -f .ant_targets ]; then return 0;
else
- accurate=$(stat -f%m .ant_targets)
- changed=$(stat -f%m build.xml)
+ accurate=$($stat_cmd -f%m .ant_targets)
+ changed=$($stat_cmd -f%m build.xml)
return $(expr $accurate '>=' $changed)
fi
}