fix: use GNU grep instead of busybox

This commit is contained in:
MDLeom 2022-01-13 06:02:34 +00:00
parent 628feedefb
commit dc834ed04a
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
1 changed files with 14 additions and 0 deletions

View File

@ -4,6 +4,20 @@
set -efux -o pipefail
## Use GNU grep, busybox grep is too slow
. "/etc/os-release"
DISTRO="$ID"
if [ -z "$(grep --help | grep 'GNU')" ]; then
if [ "$DISTRO" = "alpine" ]; then
echo "Please install GNU grep 'apk add grep'"
exit 1
fi
alias grep="/usr/bin/grep"
fi
## Detect Musl C library
LIBC="$(ldd /bin/ls | grep 'musl' || [ $? = 1 ])"
if [ -z "$LIBC" ]; then