#!/bin/sh

# uncomment this line to pack repository for dumb http protocol clone/fetch
# git update-server-info

# if repository is public, mirror to SourceHut and Codeberg
if [ -f "git-daemon-export-ok" ] && [ -f "category" ]; then
    # piping into at(1) as a workaround to let git connection finish before
    # script has finished running
    #echo "$(dirname "$(realpath "$0")")/mirror-repository $(pwd)" | at now # 2>/dev/null
    $(dirname "$(realpath "$0")")/mirror-repository $(pwd)
fi
