modules/date.sh: use TZDIR

This commit is contained in:
Pragmatic Software 2021-02-07 14:05:21 -08:00
parent 6c5d20e265
commit ea43a3a7e4
1 changed files with 3 additions and 1 deletions

4
modules/date.sh vendored
View File

@ -1,7 +1,9 @@
#!/bin/bash
export LC_TIME=C
export TZ=UTC
if (( $# )) && ! read -r TZ < <(IFS=_; find -L /usr/share/zoneinfo/posix -type f -not -iname 'West' -iname "*$**" -printf '%P\n' -quit); then
TZDIR=${TZDIR:-/usr/share/zoneinfo/posix}
if (( $# )) && ! read -r TZ < <(IFS=_; find -L "$TZDIR" -type f -not -iname 'West' -iname "*$**" -printf '%P\n' -quit); then
echo "No match for '$*'."
exit 1
fi