Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Pre-release

* Fix: Add support for `curl` versions below 7.82 (0.0.3)
14 changes: 7 additions & 7 deletions bs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ trap "trap_error" TERM
trap "trap_clean" EXIT
export TOP_PID=$$

version="0.0.2"
release="20220918"
version="0.0.3"
release="20230217"

tmpdir=$(mktemp -d /tmp/bs.XXXXXX)

Expand Down Expand Up @@ -475,13 +475,13 @@ crud () {
echo "{$data,\"$content_type\":" > "$tmpfile"
"$jq" "${jq_json_escape_options[@]}" . "$content" >> "$tmpfile"
echo "}" >> "$tmpfile"
post $branch --json "@$tmpdir/data.json"
post $branch -H 'Content-Type: application/json' --data "@$tmpdir/data.json"
unlink "$tmpfile"
else
if [ -n "$form" ]; then
post $branch "${fdata[@]}" -F "$form"
else
post $branch --json "{$data}"
post $branch -H 'Content-Type: application/json' --data "{$data}"
fi
fi
;;
Expand All @@ -496,20 +496,20 @@ crud () {
echo "{$data,\"$content_type\":" > "$tmpfile"
"$jq" "${jq_json_escape_options[@]}" . "$content" >> "$tmpfile"
echo "}" >> "$tmpfile"
put $branch "$id" --json "@$tmpdir/data.json"
put $branch "$id" -H 'Content-Type: application/json' --data "@$tmpdir/data.json"
unlink "$tmpfile"
else
if [ -n "$form" ]; then
put $branch "$id" "${fdata[@]}" -F "$form"
else
put $branch "$id" --json "{$data}"
put $branch "$id" -H 'Content-Type: application/json' --data "{$data}"
fi
fi
;;

delete)
if [ -n "$data" ]; then
delete $branch "$id" --json "{$data}"
delete $branch "$id" -H 'Content-Type: application/json' --data "{$data}"
else
delete $branch "$id"
fi
Expand Down