forked from lewagon/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitHub API does not always provide with the email. Remove this code (…
…check.rb will handle it)
- Loading branch information
Showing
1 changed file
with
1 addition
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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." |