You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

23 lines
563 B

#!/usr/bin/env bash
cd "$(dirname "$0")"
source ../helpers
if [[ -f $HOME/.gitconfig.local ]]; then exit; fi
echo '--- Gathering localized Git configuration data'
credential_helper=cache
if [[ "$OS" == macos ]]; then
credential_helper=osxkeychain
fi
printf '[git] user.name: '
read -e user_name
printf '[git] user.email: '
read -e user_email
echo '--- Building .gitconfig.local'
sed \
-e "s/USER_NAME/$user_name/g" \
-e "s/USER_EMAIL/$user_email/g" \
-e "s/CREDENTIAL_HELPER/$credential_helper/g" \
.gitconfig.local.example > $HOME/.gitconfig.local