Skip to content

Commit

Permalink
feat(alpine-linux): make ~/.gitconfig optional
Browse files Browse the repository at this point in the history
  • Loading branch information
prehor committed Jul 7, 2024
1 parent 276106e commit 5e3b0aa
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions apps/alpine-toolbox/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash

# Setup Git global config
if [ ! -e ~/.gitconfig ]; then
cat > ~/.gitconfig <<EOF
if [[ "${GITCONFIG}" =~ '^(1|on|yes|true)$' ]]; then
if [ ! -e ~/.gitconfig ]; then
cat > ~/.gitconfig <<EOF
[filter "lfs"]
process = git-lfs filter-process
required = true
Expand All @@ -14,11 +15,12 @@ if [ ! -e ~/.gitconfig ]; then
directory = /config
[user]
EOF
if [ -n "${GITCONFIG_USER_MAIL}" ]; then
echo " email = ${GITCONFIG_USER_MAIL}" >> ~/.gitconfig
fi
if [ -n "${GITCONFIG_USER_NAME}" ]; then
echo " name = ${GITCONFIG_USER_NAME}" >> ~/.gitconfig
if [ -n "${GITCONFIG_USER_MAIL}" ]; then
echo " email = ${GITCONFIG_USER_MAIL}" >> ~/.gitconfig
fi
if [ -n "${GITCONFIG_USER_NAME}" ]; then
echo " name = ${GITCONFIG_USER_NAME}" >> ~/.gitconfig
fi
fi
fi

Expand Down

0 comments on commit 5e3b0aa

Please sign in to comment.