paritybit.ca

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 47ca2083c050b081adcc3b84e476bfd4b38bd688
parent ffa30c82b25a4ca7bc37843335a27229d76154c1
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Thu,  6 Aug 2020 18:46:59 -0400

Optimize grabbing output URL of image optimization

Diffstat:
Mcompile | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/compile b/compile @@ -118,8 +118,9 @@ compile_img() response=$(curl https://api.tinify.com/shrink \ --user api:"$apiKey" \ - --data-binary @"$file") - downloadURL=$(echo "$response" | cut -d',' -f8 | cut -d':' -f2- | tr -d "\"" | tr -d "}") + --data-binary @"$file" \ + --dump-header /dev/stdout) + downloadURL=$(echo "$response" | grep location: | cut -d' ' -f2) if [ $? != 0 ]; then print_error_msg "There was an issue minifying this image." exit 1