Update 2025-04-12_12:18:05
This commit is contained in:
@ -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)
|
GITEA_API_TOKEN=$(grep '^GITEA_API_TOKEN=' ~/.netrc | head -n1 | cut -d= -f2 | xargs)
|
||||||
export GITEA_API_TOKEN
|
export GITEA_API_TOKEN
|
||||||
fi
|
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)
|
GITEA_USER=$(awk '{for(i=1;i<=NF;i++) if($i=="login") print $(i+1)}' ~/.netrc | head -n1)
|
||||||
if [ -z "$GITEA_USER" ]; then
|
if [ -z "$GITEA_USER" ]; then
|
||||||
log ERROR "No login found in ~/.netrc"
|
log ERROR "No login found in ~/.netrc"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
GITEA_URL="https://$(awk '{for(i=1;i<=NF;i++) if($i=="machine") print $(i+1)}' ~/.netrc | head -n1)"
|
GITEA_URL="https://$(awk '{for(i=1;i<=NF;i++) if($i=="machine") print $(i+1)}' ~/.netrc | head -n1)"
|
||||||
if [ -z "$GITEA_URL" ]; then
|
if [ -z "$GITEA_URL" ]; then
|
||||||
log ERROR "No URL found in ~/.netrc"
|
log ERROR "No URL found in ~/.netrc"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
GITEA_API_URL="$GITEA_URL/api/v1"
|
GITEA_API_URL="$GITEA_URL/api/v1"
|
||||||
fi
|
|
||||||
PRIVATE=false
|
PRIVATE=false
|
||||||
DEBUG=false
|
DEBUG=false
|
||||||
COMMIT_MESSAGE="Update $(date +%F_%T)"
|
COMMIT_MESSAGE="Update $(date +%F_%T)"
|
||||||
@ -193,7 +194,6 @@ fi
|
|||||||
# Ensure at least one commit exists
|
# Ensure at least one commit exists
|
||||||
prepare_commit
|
prepare_commit
|
||||||
|
|
||||||
|
|
||||||
# Set or update remote
|
# Set or update remote
|
||||||
if [ "$HTTP_STATUS" -eq 200 ]; then
|
if [ "$HTTP_STATUS" -eq 200 ]; then
|
||||||
setup_remote
|
setup_remote
|
||||||
|
Reference in New Issue
Block a user