Created
September 13, 2021 04:43
-
-
Save zeroiszero/de35f91f10fdf392f6da34a9db71dc8a to your computer and use it in GitHub Desktop.
Reference: https://github.com/antfu/1990-script
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
#!/usr/bin/env sh | |
_() { | |
YEAR="1991" | |
echo "Github Username: " | |
read -r USERNAME | |
[ -z "$USERNAME" ] && exit 1 | |
[ ! -d $YEAR ] && mkdir $YEAR | |
cd "${YEAR}" || exit | |
git init | |
echo "**${YEAR}** - Generated by https://github.com/antfu/1990-script" \ | |
>README.md | |
git add . | |
GIT_AUTHOR_DATE="${YEAR}-01-01T18:00:00" \ | |
GIT_COMMITTER_DATE="${YEAR}-01-01T18:00:00" \ | |
git commit -m "${YEAR}" | |
git remote add origin "https://github.com/${USERNAME}/${YEAR}.git" | |
git branch -M main | |
git push -u origin main -f | |
cd .. | |
rm -rf "${YEAR}" | |
echo | |
echo "Cool, check your profile now: https://github.com/${USERNAME}" | |
} && _ | |
unset -f _ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment