mirror of
https://github.com/Tarrasch/zsh-autoenv.git
synced 2024-11-25 16:31:00 +02:00
Handle failure of loading zsh/stat
This commit is contained in:
parent
f5077e320d
commit
936b5eaf77
@ -122,7 +122,14 @@ _autoenv_debug() {
|
||||
# }}}
|
||||
|
||||
# Load zstat module, but only its builtin `zstat`.
|
||||
zmodload -F zsh/stat b:zstat
|
||||
if ! zmodload -F zsh/stat b:zstat 2>/dev/null; then
|
||||
# If the module is not available, define a wrapper around `stat`, and use its
|
||||
# terse output instead of format, which is not supported by busybox.
|
||||
# Assume '+mtime' as $1.
|
||||
zstat() {
|
||||
stat -t $2 | cut -f13 -d ' '
|
||||
}
|
||||
fi
|
||||
|
||||
|
||||
# Generate hash pair for a given file ($1).
|
||||
|
Loading…
Reference in New Issue
Block a user