Update 2025-04-12_12:18:05

This commit is contained in:
oib
2025-04-12 12:18:06 +02:00
parent ada5844ce3
commit f8fe4e1722

View File

@ -10,19 +10,20 @@ if [ -z "$GITEA_API_TOKEN" ] && grep -q '^GITEA_API_TOKEN=' ~/.netrc 2>/dev/null
GITEA_API_TOKEN=$(grep '^GITEA_API_TOKEN=' ~/.netrc | head -n1 | cut -d= -f2 | xargs)
export GITEA_API_TOKEN
fi
if grep -q 'login ' ~/.netrc 2>/dev/null; then
GITEA_USER=$(awk '{for(i=1;i<=NF;i++) if($i=="login") print $(i+1)}' ~/.netrc | head -n1)
if [ -z "$GITEA_USER" ]; then
log ERROR "No login found in ~/.netrc"
exit 1
fi
GITEA_URL="https://$(awk '{for(i=1;i<=NF;i++) if($i=="machine") print $(i+1)}' ~/.netrc | head -n1)"
if [ -z "$GITEA_URL" ]; then
log ERROR "No URL found in ~/.netrc"
exit 1
fi
GITEA_API_URL="$GITEA_URL/api/v1"
fi
PRIVATE=false
DEBUG=false
COMMIT_MESSAGE="Update $(date +%F_%T)"
@ -193,7 +194,6 @@ fi
# Ensure at least one commit exists
prepare_commit
# Set or update remote
if [ "$HTTP_STATUS" -eq 200 ]; then
setup_remote