mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-19 21:41:07 +01:00
Use [ -nt ] instead of stat -f%m to check cache files.
This commit is contained in:
parent
0ab0e67ecf
commit
300f94cb0e
4 changed files with 13 additions and 42 deletions
|
@ -1,17 +1,7 @@
|
||||||
stat -f%m . > /dev/null 2>&1
|
|
||||||
if [ "$?" = 0 ]; then
|
|
||||||
stat_cmd=(stat -f%m)
|
|
||||||
else
|
|
||||||
stat_cmd=(stat -L --format=%Y)
|
|
||||||
fi
|
|
||||||
|
|
||||||
_ant_does_target_list_need_generating () {
|
_ant_does_target_list_need_generating () {
|
||||||
if [ ! -f .ant_targets ]; then return 0;
|
[ ! -f .ant_targets ] && return 0;
|
||||||
else
|
[ .ant_targets -nt build.xml ] && return 0;
|
||||||
accurate=$($stat_cmd .ant_targets)
|
return 1;
|
||||||
changed=$($stat_cmd build.xml)
|
|
||||||
return $(expr $accurate '>=' $changed)
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_ant () {
|
_ant () {
|
||||||
|
|
|
@ -14,12 +14,9 @@ _cake_does_target_list_need_generating () {
|
||||||
return 1;
|
return 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f ${_cake_task_cache_file} ]; then return 0;
|
[ ! -f ${_cake_task_cache_file} ] && return 0;
|
||||||
else
|
[ ${_cake_task_cache_file} -nt Cakefile ] && return 0;
|
||||||
accurate=$(stat -f%m $_cake_task_cache_file)
|
return 1;
|
||||||
changed=$(stat -f%m Cakefile)
|
|
||||||
return $(expr $accurate '>=' $changed)
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_cake () {
|
_cake () {
|
||||||
|
|
|
@ -54,27 +54,14 @@ function in_gradle() {
|
||||||
fi
|
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
|
############################################################################## Examine the build.gradle file to see if its
|
||||||
# timestamp has changed, and if so, regen
|
# timestamp has changed, and if so, regen
|
||||||
# the .gradle_tasks cache file
|
# the .gradle_tasks cache file
|
||||||
############################################################################
|
############################################################################
|
||||||
_gradle_does_task_list_need_generating () {
|
_gradle_does_task_list_need_generating () {
|
||||||
if [ ! -f .gradletasknamecache ]; then return 0;
|
[ ! -f .gradletasknamecache ] && return 0;
|
||||||
else
|
[ .gradletasknamecache -nt build.gradle ] && return 0;
|
||||||
accurate=$($stat_cmd .gradletasknamecache)
|
return 1;
|
||||||
changed=$($stat_cmd build.gradle)
|
|
||||||
return $(expr $accurate '>=' $changed)
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
_phing_does_target_list_need_generating () {
|
_phing_does_target_list_need_generating () {
|
||||||
if [ ! -f .phing_targets ]; then return 0;
|
[ ! -f .phing_targets ] && return 0;
|
||||||
else
|
[ .phing_targets -nt build.xml ] && return 0;
|
||||||
accurate=$(stat -f%m .phing_targets)
|
return 1;
|
||||||
changed=$(stat -f%m build.xml)
|
|
||||||
return $(expr $accurate '>=' $changed)
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_phing () {
|
_phing () {
|
||||||
|
|
Loading…
Reference in a new issue