From b3eb8324ae6324a925960501f8bb3968ba32e1c9 Mon Sep 17 00:00:00 2001 From: MDLeom <2809763-curben@users.noreply.gitlab.com> Date: Wed, 12 Jan 2022 06:50:06 +0000 Subject: [PATCH] fix: use GNU grep instead of busybox --- src/script.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/script.sh b/src/script.sh index 10d427f0..8d072caa 100644 --- a/src/script.sh +++ b/src/script.sh @@ -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 + + ## Create a temporary working folder mkdir -p "tmp/" cd "tmp/"