mirror of
https://github.com/Tarrasch/zsh-autoenv.git
synced 2024-11-23 23:50:58 +02:00
Fix _autoenv_get_file_mtime for zsh 4 (no pipefail option)
This commit is contained in:
parent
b725b5da9b
commit
e6e906e6b9
10
autoenv.zsh
10
autoenv.zsh
@ -66,8 +66,14 @@ if ! zmodload -F zsh/stat b:zstat 2>/dev/null; then
|
|||||||
# terse output instead of format, which is not supported by busybox.
|
# terse output instead of format, which is not supported by busybox.
|
||||||
# Assume '+mtime' as $1.
|
# Assume '+mtime' as $1.
|
||||||
_autoenv_get_file_mtime() {
|
_autoenv_get_file_mtime() {
|
||||||
setopt localoptions pipefail
|
# setopt localoptions pipefail
|
||||||
stat -t $1 2>/dev/null | cut -f13 -d ' ' || echo 0
|
local stat
|
||||||
|
stat=$(stat -t $1 2>/dev/null)
|
||||||
|
if [[ -n $stat ]]; then
|
||||||
|
echo ${${(s: :)stat}[13]}
|
||||||
|
else
|
||||||
|
echo 0
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_autoenv_get_file_mtime() {
|
_autoenv_get_file_mtime() {
|
||||||
|
Loading…
Reference in New Issue
Block a user