aboutsummaryrefslogtreecommitdiff
path: root/norns_upload
diff options
context:
space:
mode:
Diffstat (limited to 'norns_upload')
-rwxr-xr-xnorns_upload9
1 files changed, 6 insertions, 3 deletions
diff --git a/norns_upload b/norns_upload
index c67ea6c..73f34ee 100755
--- a/norns_upload
+++ b/norns_upload
@@ -38,6 +38,9 @@ echo $'\r\n'"--$BOUNDARY--"$'\r\n' >> $TEMP
# thanks monome >:)
curl -XPUT "$DIR_URL" --silent > /dev/null
-# TODO this should exit 1 if this doesn't work
-# looks like we need to parse this.
-curl "$URL" -X PUT -H "Content-Type: multipart/form-data; boundary=$BOUNDARY" --data-binary @$TEMP --compressed --silent > /dev/null
+# all we get is an error message in json if this fails
+RESULT="$(curl "$URL" -X PUT -H "Content-Type: multipart/form-data; boundary=$BOUNDARY" --data-binary @$TEMP --compressed --silent)"
+if jq -e ".error"<<<"$RESULT" >/dev/null; then
+ jq -r ".error" <<<"$RESULT"
+ exit 1
+fi