diff options
author | Robby Russell <robby@planetargon.com> | 2013-04-07 19:05:59 -0700 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2013-04-07 19:05:59 -0700 |
commit | dda1154c80ec0b8ad02846240e4c5d701279b296 (patch) | |
tree | 7f50747e55f49c431cae2e51ffcf189300fb571a /plugins/gradle | |
parent | e041b5074243b549b4c16dc9f0d4b6bd33457a46 (diff) | |
parent | bdf4f5a347789069dda438e64467344b551fff00 (diff) | |
download | zsh-dda1154c80ec0b8ad02846240e4c5d701279b296.tar.gz zsh-dda1154c80ec0b8ad02846240e4c5d701279b296.tar.bz2 zsh-dda1154c80ec0b8ad02846240e4c5d701279b296.zip |
Merge pull request #1655 from nubs/phing-and-cache-files
Improve portability of cache file detection for command targets
Diffstat (limited to 'plugins/gradle')
-rw-r--r-- | plugins/gradle/gradle.plugin.zsh | 19 |
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; } |