cli/upload.sh
Aravinth Manivannan 6f70f0aa86
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
feat: init reuse.software
2023-10-23 19:10:58 +05:30

26 lines
568 B
Bash
Executable file

#!/bin/bash
# SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
#
# SPDX-License-Identifier: MIT
set -xEeuo pipefail
readonly UPLOAD_DIR="cli/master"
readonly DUMBSERVE_HOST="https://$DUMBSERVE_USERNAME:$DUMBSERVE_PASSWORD@dl.mcaptcha.org"
curl --location --request DELETE "$DUMBSERVE_HOST/api/v1/files/delete" \
--header 'Content-Type: application/json' \
--data-raw "{
\"path\": \"$UPLOAD_DIR\"
}"
pushd dist/
for file in *
do
curl -v \
-F upload=@$file \
"$DUMBSERVE_HOST/api/v1/files/upload?path=$UPLOAD_DIR"
done
popd