Skip to content

Commit 1195eb2

Browse files
authored
Only adjust /etc/gitconfig if it exists
1 parent 41ccce2 commit 1195eb2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/repos/scripts/git-auth.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ setup_gitconfig() {
7878
7979
# Remove the default credential helper
8080
if [[ "$auth_gitconfig_scope" == "system" ]]; then
81-
sed -i -E 's/helper =.*//' /etc/gitconfig
81+
if [ -f "/etc/gitconfig" ]; then
82+
sed -i -E 's/helper =.*//' /etc/gitconfig
83+
fi
8284
elif [[ "$auth_gitconfig_scope" == "global" ]]; then
8385
git config --global --unset credential.helper
8486
elif [[ "$auth_gitconfig_scope" == "local" ]]; then

0 commit comments

Comments
 (0)