Skip to content

Commit

Permalink
GitHub API does not always provide with the email. Remove this code (…
Browse files Browse the repository at this point in the history
…check.rb will handle it)
  • Loading branch information
ssaunier committed Jan 29, 2018
1 parent 5a9c0d1 commit 7e91c76
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions git_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,4 @@ git push origin master

git remote add upstream [email protected]:lewagon/dotfiles.git

GITHUB_NICKNAME=$(git remote get-url --push origin | cut -d ":" -f 2 | cut -d "/" -f 1)
GITHUB_EMAIL=$(curl -s https://api.github.com/repos/${GITHUB_NICKNAME}/dotfiles/commits/`git rev-parse HEAD` | jq -r '.commit.author.email')
GIT_EMAIL=$(git config --global user.email)

if [ "${GITHUB_EMAIL}" = "${GIT_EMAIL}" ] || [ -z ${GITHUB_EMAIL} ]
then
echo "👌 Awesome, all set."
else
echo "⚠️ Mismatch! Your GitHub email is ${GITHUB_EMAIL} whereas your git email is ${GIT_EMAIL}"
echo "You should run these commands to fix it:"
echo " git config --global user.email ${GITHUB_EMAIL}"
echo " git commit --amend --author '${full_name}<${GITHUB_EMAIL}>'"
echo " git push --force origin master"
fi
echo "👌 Awesome, all set."

0 comments on commit 7e91c76

Please sign in to comment.