#!/usr/bin/env bash # you should never call this script from a non-public repository, but just in # case... if [ ! -f "git-daemon-export-ok" ] || [ ! -f "category" ]; then exit 1 fi set -e trap "notify \"ERROR pushing $repo\" \"There was an error pushing $repo to either SourceHut or GitHub.\"" ERR dir="$(pwd)" repo="$(basename "$(pwd)" ".git")" git -C "$dir" remote get-url srht || \ git -C "$dir" remote add srht "git@git.sr.ht:~ob/$repo" git -C "$dir" push --all --force --prune srht git -C "$dir" push --tags --force --prune srht git -C "$dir" remote get-url github || \ git -C "$dir" remote add github "git@github.com:oscarbenedito/$repo" git -C "$dir" push --all --force --prune github git -C "$dir" push --tags --force --prune github