04573324d52aaadf947f3a80190e4f54d8580932
- Author
- Martin Thurau <martin.thurau@gmail.com>
- Committer
- Martin Thurau <martin.thurau@gmail.com>
- Date
Message
Added compatibility for the linux 'stat' command for the ant plugin
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 }