From c98b80deaf0cd8e24a9246cadcb11e5a9f21d122 Mon Sep 17 00:00:00 2001
From: Maximilian Moser <maximilian.moser@tuwien.ac.at>
Date: Wed, 18 Sep 2024 10:29:16 +0200
Subject: [PATCH] Use the "raw-output" flag for jq to get rid of surrounding
 quotation

---
 upload/upload.sh | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/upload/upload.sh b/upload/upload.sh
index 0bd6e76..562fdc8 100755
--- a/upload/upload.sh
+++ b/upload/upload.sh
@@ -108,9 +108,7 @@ recids=()
 # upload the collected records with files
 for record in ${record_dirs[@]}; do
 	# create a new draft, with the specified metadata
-	recid=$(curl -sk -X POST -H "${json_header}" -H "${auth_header}" -d @${record}/metadata.json ${base_url}/api/records | jq ".id")
-	recid=${recid%\"}
-	recid=${recid#\"}
+	recid=$(curl -sk -X POST -H "${json_header}" -H "${auth_header}" -d @${record}/metadata.json ${base_url}/api/records | jq -r ".id")
 	recids+=( ${recid} )
 
 	files=()
-- 
GitLab