modules/date.sh: print errors to stdout

This commit is contained in:
Pragmatic Software 2020-01-25 15:32:25 -08:00
parent b66596d9ed
commit 5150fc6752
1 changed files with 2 additions and 2 deletions

4
modules/date.sh vendored
View File

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