d708f5ddc1410a3adaa4d9aab025f1abf5054c9c
- Author
- Robby Russell <robby@planetargon.com>
- Committer
- Robby Russell <robby@planetargon.com>
- Date
Message
Merge pull request #363 from Blattlaus/master
Ant plugin: stat command doesn't work under linux
Diff
1diff --git a/plugins/ant/ant.plugin.zsh b/plugins/ant/ant.plugin.zsh
2index 0544ac92cb18ccfee2fc204b4050cbd1b93923da..23bc7756a9ad98aaebc3ec99c81af69987fdef2f 100644
3--- a/plugins/ant/ant.plugin.zsh
4+++ b/plugins/ant/ant.plugin.zsh
5@@ -1,8 +1,15 @@
6+stat -f%m . > /dev/null 2>&1
7+if [ "$?" = 0 ]; then
8+ stat_cmd=(stat -f%m)
9+else
10+ stat_cmd=(stat -L --format=%y)
11+fi
12+
13 _ant_does_target_list_need_generating () {
14 if [ ! -f .ant_targets ]; then return 0;
15 else
16- accurate=$(stat -f%m .ant_targets)
17- changed=$(stat -f%m build.xml)
18+ accurate=$($stat_cmd -f%m .ant_targets)
19+ changed=$($stat_cmd -f%m build.xml)
20 return $(expr $accurate '>=' $changed)
21 fi
22 }