script added, README expanded

This commit is contained in:
GitSnub 2020-10-27 03:59:00 +01:00
parent 2e85759c3c
commit 651e51dc65
2 changed files with 53 additions and 0 deletions

View File

@ -33,6 +33,8 @@ So, I guess this is fine:
- https://github.com/microsoft/MLOS/blob/e4b537d25a5bfdea3bb0f2910b5b404b3d4de7db/GITHUB_IS_EVIL.md
- https://github.com/github/training-kit/blob/7fdaaf1b4deed2689669e16959625c9be9485ace/GITHUB_IS_EVIL.md
- https://github.com/microsoft/TypeScript/blob/a8fcd50d4ccff302b8175275230b05b252d3a1b4/GITHUB_IS_EVIL.md
- https://github.com/microsoft/terminal/blob/9bd080ddbbfffd03925b9625ae534fe214283b11/GITHUB_IS_EVIL.md
- https://github.com/github/VisualStudio/blob/adb9631620d67164c429cf59b023863c7b21b423/GITHUB_IS_EVIL.md
## Better alternatives
@ -42,3 +44,10 @@ More importantly, stop using Microsoft GitHub. There are many alternatives, here
- [SourceHut](https://sr.ht/) is a nice, ethical forge.
- [GitLab](https://gitlab.com/) is a good "batteries-included" alternative; it is self-hostable, or you can set-up an account on one of the many public instances.
- [Gitea](https://gitea.io/en-us/) is a minimalistic self-hostable forge.
## GitSnub
GitSnub is here:
- https://fosstodon.org/@gitsnub
- https://github.com/gitsnub/gitsnub/
- repo outside of GitHub coming next

44
gitsnub.sh Executable file
View File

@ -0,0 +1,44 @@
#!/bin/bash
# this code is horrid.
set -e
if [[ "$GITHUB_TOKEN" == '' ]]; then
echo "GITHUB_TOKEN seems empty"
echo "You can generate one here: https://github.com/settings/tokens"
echo
echo "Once you have it, do:"
echo "export GITHUB_TOKEN=<token>"
exit 1
fi
if [[ "$1" == "" ]] || [[ "$1" == "--help" ]]; then
echo
echo "usage:"
echo " $0 someorg/project otherorg/project ..."
exit 0
fi
COMMIT_HASH_URLS=""
for p in "$@"; do
echo "+-- forking: $p"
gh repo fork "$p" --clone=true
done
for d in */; do
cp README.md $d/GITHUB_IS_EVIL.md
cd $d/
git add ./
sed -i -r -e "s#url = https://github#url = https://x-access-token:$GITHUB_TOKEN@github#" .git/config
git commit -m '#Hacktoberfest'
git push
COMMIT_HASH_URLS="$COMMIT_HASH_URLS
$(git remote get-url upstream | sed -r -e 's/x-access.+\@//' -r -e 's#\.git#/blob/#' | tr -d '\n'; git rev-parse HEAD | tr -d '\n' )/GITHUB_IS_EVIL.md"
cd ../
done
echo
echo
echo "$COMMIT_HASH_URLS"