Skip to content

Instantly share code, notes, and snippets.

@zeroiszero
Created September 13, 2021 04:43
Show Gist options
  • Save zeroiszero/de35f91f10fdf392f6da34a9db71dc8a to your computer and use it in GitHub Desktop.
Save zeroiszero/de35f91f10fdf392f6da34a9db71dc8a to your computer and use it in GitHub Desktop.
#!/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