|
|
|
@ -1,11 +1,7 @@
|
|
|
|
|
#!/usr/bin/env sh
|
|
|
|
|
|
|
|
|
|
# Convert templated variables to shell variables
|
|
|
|
|
GIT_EMAIL=${GIT_EMAIL}
|
|
|
|
|
GIT_USERNAME=${GIT_USERNAME}
|
|
|
|
|
|
|
|
|
|
BOLD='\033[0;1m'
|
|
|
|
|
printf "$${BOLD}Checking git-config!\n\n"
|
|
|
|
|
printf "$${BOLD}Checking git-config!\n"
|
|
|
|
|
|
|
|
|
|
# Check if git is installed
|
|
|
|
|
command -v git >/dev/null 2>&1 || {
|
|
|
|
@ -14,15 +10,15 @@ command -v git > /dev/null 2>&1 || {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Set git username and email if missing
|
|
|
|
|
if [ -z "$(git config --get user.email)" ]; then
|
|
|
|
|
printf "git-config: No user.email found, setting to %s\n" "$${GIT_EMAIL}"
|
|
|
|
|
git config --global user.email "$${GIT_EMAIL}"
|
|
|
|
|
if [ -z $(git config --get user.email) ]; then
|
|
|
|
|
printf "git-config: No user.email found, setting to ${GIT_EMAIL}\n"
|
|
|
|
|
git config --global user.email "${GIT_EMAIL}"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ -z "$(git config --get user.name)" ]; then
|
|
|
|
|
printf "git-config: No user.name found, setting to $${GIT_USERNAME}\n\n"
|
|
|
|
|
git config --global user.name "$${GIT_USERNAME}"
|
|
|
|
|
if [ -z $(git config --get user.name) ]; then
|
|
|
|
|
printf "git-config: No user.name found, setting to ${GIT_USERNAME}\n"
|
|
|
|
|
git config --global user.name "${GIT_USERNAME}"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
printf "$${BOLD}git-config: using email: $(git config --get user.email)\n"
|
|
|
|
|
printf "\n$${BOLD}git-config: using email: $(git config --get user.email)\n"
|
|
|
|
|
printf "$${BOLD}git-config: using username: $(git config --get user.name)\n\n"
|
|
|
|
|