Make rushlink --delete work with urls that have a file extension.

This commit is contained in:
Mara Bos 2020-03-24 14:42:00 +01:00
parent ad1ce67495
commit 8403ad2258
1 changed files with 3 additions and 0 deletions

View File

@ -31,6 +31,9 @@ del() {
URL="$LINK$1"
;;
esac
# Remove file extension, if any.
NAME="${URL##*/}"
URL="${URL%/*}/${NAME%%.*}"
if DELURL=$(grep -s -m1 "$URL?deleteToken=" "$DELFILE"); then
echo "Deleting $URL..." >&2
curl -sS -X DELETE "$DELURL" | grep deleted