zmodload -F zsh/stat b:zstat
+# Generate hash pair for a given file ($1).
+# A fixed hash value can be given as 2nd arg, but is used with tests only.
_autoenv_hash_pair() {
local env_file=${1:A}
local env_shasum
if [[ -n $2 ]]; then
env_shasum=$2
else
+ if ! [[ -e $env_file ]]; then
+ echo "Missing file argument for _autoenv_hash_pair!" >&2
+ return 1
+ fi
env_shasum=$(shasum $env_file | cut -d' ' -f1)
fi
echo "$env_file:$env_shasum:1"