Browse code

Merge pull request #363 from Blattlaus/master

Ant plugin: stat command doesn't work under linux

Robby Russell authored on 29/05/2011 at 10:54:40
Showing 1 changed files
... ...
@@ -1,8 +1,15 @@
1
+stat -f%m . > /dev/null 2>&1
2
+if [ "$?" = 0 ]; then
3
+	stat_cmd=(stat -f%m)
4
+else
5
+	stat_cmd=(stat -L --format=%y)
6
+fi
7
+
1 8
 _ant_does_target_list_need_generating () {
2 9
   if [ ! -f .ant_targets ]; then return 0;
3 10
   else
4
-    accurate=$(stat -f%m .ant_targets)
5
-    changed=$(stat -f%m build.xml)
11
+    accurate=$($stat_cmd -f%m .ant_targets)
12
+    changed=$($stat_cmd -f%m build.xml)
6 13
     return $(expr $accurate '>=' $changed)
7 14
   fi
8 15
 }