.dotfiles/.local/bin/giteadelimg
2024-12-27 11:43:30 +00:00

19 lines
434 B
Bash
Executable File

#!/bin/bash
read -rsp "PASSWD: " PASSWD; echo
read -rp "OWNER: " OWN
read -rp "NAME: " NAME
TOK="$(jq -rR '@uri' <<< "$PASSWD")"
API="https://ange:$TOK@git.gmoker.com/api/v1/packages"
PKG="$(curl "$API/$OWN" | jq -r ".[] | select(.name == \"$NAME\").version")"
echo "$PKG"
read -rp "Continue?"
while read -r pkg; do
(set -x
curl -XDELETE "$API/$OWN/container/$(jq -rR '@uri' <<< "$NAME")/$pkg"
)
done <<< "$PKG"