From 2c89796f12e9a63d07b167925ef23434f9193ad7 Mon Sep 17 00:00:00 2001 From: Lu Baumann Date: Mon, 16 Oct 2023 19:29:03 +0200 Subject: [PATCH] tried fixing kroki query --- to_svg.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/to_svg.sh b/to_svg.sh index 75c4f87..0583819 100755 --- a/to_svg.sh +++ b/to_svg.sh @@ -1,7 +1,10 @@ #!/usr/bin/env bash echo ::debug::'$1:' "$1" echo ::debug::'$2:' "$2" -EXCALIDRAW=$(jq '{"type": .type, "version": .version, "source": .source, "elements": .elements, "appState": {"gridSize": null, "exportWithDarkMode": '"$2"'}}' "$1") +EXCALIDRAW="$(jq '{"type": .type, "version": .version, "source": .source, "elements": .elements, "appState": {"gridSize": null, "exportWithDarkMode": '"$2"'}}' "$1")" +ENCODED="$(echo $EXCALIDRAW | python -c "import sys; import base64; import zlib; print(base64.urlsafe_b64encode(zlib.compress(sys.stdin.read().encode('utf-8'), 9)).decode('ascii'))")" echo ::debug::'$EXCALIDRAW' "$EXCALIDRAW" -curl localhost:8080/excalidraw/svg --data-raw "$EXCALIDRAW" > "$1.svg" +echo ::debug::'$ENCODED' "$ENCODED" +docker ps +curl "localhost:8080/excalidraw/svg/$ENCODED" > "$1.svg" echo ::debug::"svg: $(cat $1.svg)"