Suppress error if gitconfig file does not exists (#3998)

* Suppress error if gitconfig file does not exists.

* Use grep

* Supress error
This commit is contained in:
Igor Pečovnik
2022-07-16 16:59:40 +02:00
committed by GitHub
parent 3e73c82956
commit f10e9fa484

View File

@@ -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