mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-28 22:57:37 +00:00
23 lines
477 B
Bash
Executable file
23 lines
477 B
Bash
Executable file
#!/bin/bash -e
|
|
|
|
die() {
|
|
echo >&2 "$@"
|
|
exit 1
|
|
}
|
|
|
|
(( $# >= 2 )) || die "Usage: $0 TOKEN-FILE SYMBOL-ARCHIVE..."
|
|
token="$1"
|
|
shift
|
|
|
|
[[ -f $token && -s $token ]] || die "Invalid TOKEN-FILE ${token@Q}"
|
|
|
|
for zip; do
|
|
[[ $(file -Ebi "$zip") == application/zip* ]] || die "Invalid SYMBOL-ARCHIVE ${zip@Q}"
|
|
done
|
|
|
|
for zip; do
|
|
echo >&2 "Uploading ${zip@Q} ..."
|
|
curl -X POST -H "Auth-Token: $(<"$token")" -F "${zip##*/}=@$zip" \
|
|
https://symbols.mozilla.org/upload/
|
|
echo
|
|
done
|