From f10e9fa4841a21d2fe28c77bd7cd9de4b3fb8b9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20Pe=C4=8Dovnik?= Date: Sat, 16 Jul 2022 16:59:40 +0200 Subject: [PATCH] Suppress error if gitconfig file does not exists (#3998) * Suppress error if gitconfig file does not exists. * Use grep * Supress error --- compile.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compile.sh b/compile.sh index 002404c7d4..11b6edf208 100755 --- a/compile.sh +++ b/compile.sh @@ -30,7 +30,7 @@ fi if [[ -f "${SRC}"/lib/general.sh ]]; then # Declare this folder as safe - if [[ -z $(cat ${HOME}/.gitconfig | grep "directory = \*") ]]; then + if ! grep -q 2>/dev/null "directory = \*" "$HOME/.gitconfig"; then git config --global --add safe.directory "*" fi