summaryrefslogtreecommitdiff
path: root/plugins/gradle
diff options
context:
space:
mode:
authorSpencer Rinehart <anubis@overthemonkey.com>2013-03-12 13:11:18 -0400
committerSpencer Rinehart <anubis@overthemonkey.com>2013-03-12 13:23:30 -0400
commit300f94cb0e1121e7796edbedcbc6d686e755be5b (patch)
treea79be9894b339fc270042c5023fa536c0580be1e /plugins/gradle
parent0ab0e67ecfc52b4779b700149a9c51feeb05318e (diff)
downloadzsh-300f94cb0e1121e7796edbedcbc6d686e755be5b.tar.gz
zsh-300f94cb0e1121e7796edbedcbc6d686e755be5b.tar.bz2
zsh-300f94cb0e1121e7796edbedcbc6d686e755be5b.zip
Use [ -nt ] instead of stat -f%m to check cache files.
Diffstat (limited to 'plugins/gradle')
-rw-r--r--plugins/gradle/gradle.plugin.zsh19
1 files changed, 3 insertions, 16 deletions
diff --git a/plugins/gradle/gradle.plugin.zsh b/plugins/gradle/gradle.plugin.zsh
index fc4c78c50..9229512f7 100644
--- a/plugins/gradle/gradle.plugin.zsh
+++ b/plugins/gradle/gradle.plugin.zsh
@@ -54,27 +54,14 @@ function in_gradle() {
fi
}
-############################################################################
-# Define the stat_cmd command based on platform behavior
-##########################################################################
-stat -f%m . > /dev/null 2>&1
-if [ "$?" = 0 ]; then
- stat_cmd=(stat -f%m)
-else
- stat_cmd=(stat -L --format=%Y)
-fi
-
############################################################################## Examine the build.gradle file to see if its
# timestamp has changed, and if so, regen
# the .gradle_tasks cache file
############################################################################
_gradle_does_task_list_need_generating () {
- if [ ! -f .gradletasknamecache ]; then return 0;
- else
- accurate=$($stat_cmd .gradletasknamecache)
- changed=$($stat_cmd build.gradle)
- return $(expr $accurate '>=' $changed)
- fi
+ [ ! -f .gradletasknamecache ] && return 0;
+ [ .gradletasknamecache -nt build.gradle ] && return 0;
+ return 1;
}