3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-01 17:16:39 +02:00

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

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