initial commit
This commit is contained in:
17
delete-gitea-projects.sh
Executable file
17
delete-gitea-projects.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
# BUG: need to repeat until all repos are gone...it's not getting all of them
|
||||
|
||||
source config.sh
|
||||
|
||||
for ((i=1; ; i+=1)); do
|
||||
contents=$(curl -sX GET "${GT_DOMAIN}/api/v1/user/repos?limit=30&page=${i}" -H "Accept: application/json" -H "Authorization: token ${GT_TOKEN}")
|
||||
if [ "$(echo $contents | jq -e '. | length == 0')" == "true" ]; then
|
||||
break
|
||||
fi
|
||||
for repo in $(echo "$contents" | jq -r '.[].name')
|
||||
do
|
||||
echo $repo
|
||||
curl -sX DELETE "${GT_DOMAIN}/api/v1/repos/${GT_USER}/${repo}" -H "Accept: application/json" -H "Authorization: token ${GT_TOKEN}"
|
||||
done
|
||||
done
|
||||
Reference in New Issue
Block a user