brew.sh: handle systems with no 'locale'

such as Alpine Linux

Closes Linuxbrew/docker#83
This commit is contained in:
Maxim Belkin 2020-08-12 21:08:14 +00:00
parent 6d9bf7286e
commit ecbe2213e4

View File

@ -6,7 +6,10 @@ case "$HOMEBREW_SYSTEM" in
esac esac
# Force UTF-8 to avoid encoding issues for users with broken locale settings. # Force UTF-8 to avoid encoding issues for users with broken locale settings.
if [[ "$(locale charmap 2>/dev/null)" != "UTF-8" ]] if ! which locale &>/dev/null
then
export LC_ALL=C
elif [[ "$(locale charmap 2>/dev/null)" != "UTF-8" ]]
then then
if [[ -n "$HOMEBREW_MACOS" ]] if [[ -n "$HOMEBREW_MACOS" ]]
then then