Skip to content

Commit

Permalink
Update fetch.sh
Browse files Browse the repository at this point in the history
To make the usage of mktemp compatible with BSD mktemp in macOS.
And add the `---max-time` option to curl.
  • Loading branch information
eliflores committed Sep 8, 2023
1 parent 8c8fecb commit 3c200b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions enmeshed/fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ function get_attributes() {
}

function init() {
TARGET=$(mktemp --suffix .png)
TMP_FILE=$(mktemp)
mv "$TMP_FILE" "$TMP_FILE".png
TARGET=$TMP_FILE.png

if [ -n "$1" ]; then
QUERY_STRING="?sessionId=$1&name=Anna%20Musterfrau"
fi

curl -X POST "http://localhost:3001/enmeshed/init$QUERY_STRING" > "$TARGET"
curl --max-time 60 -X POST "http://localhost:3001/enmeshed/init$QUERY_STRING" > "$TARGET"

open "$TARGET"
}
Expand Down

0 comments on commit 3c200b6

Please sign in to comment.