Commit 50ebcd2d authored by tom's avatar tom

log preview URL

parent 4d052764
/output /output
config.json config.json
response.json
favicon_package** favicon_package**
\ No newline at end of file
...@@ -54,6 +54,7 @@ echo "$API_RESPONSE" > response.json ...@@ -54,6 +54,7 @@ echo "$API_RESPONSE" > response.json
# Parse the JSON response to extract the file URL and remove backslashes # Parse the JSON response to extract the file URL and remove backslashes
FILE_URL=$(echo "$API_RESPONSE" | jq -r '.favicon_generation_result.favicon.package_url' | tr -d '\\') FILE_URL=$(echo "$API_RESPONSE" | jq -r '.favicon_generation_result.favicon.package_url' | tr -d '\\')
PREVIEW_URL=$(echo "$API_RESPONSE" | jq -r '.favicon_generation_result.preview_picture_url' | tr -d '\\')
# Check if FILE_URL is empty # Check if FILE_URL is empty
if [ -z "$FILE_URL" ]; then if [ -z "$FILE_URL" ]; then
...@@ -62,6 +63,7 @@ if [ -z "$FILE_URL" ]; then ...@@ -62,6 +63,7 @@ if [ -z "$FILE_URL" ]; then
fi fi
echo "🆗 Found following file URL in the response: $FILE_URL" echo "🆗 Found following file URL in the response: $FILE_URL"
echo "🆗 Favicon preview URL: $PREVIEW_URL"
echo echo
# Generate a filename based on the URL # Generate a filename based on the URL
...@@ -69,10 +71,9 @@ FILE_NAME=$(basename "$FILE_URL") ...@@ -69,10 +71,9 @@ FILE_NAME=$(basename "$FILE_URL")
# Check if the target folder exists and clear its contents if it does # Check if the target folder exists and clear its contents if it does
if [ -d "$TARGET_FOLDER" ]; then if [ -d "$TARGET_FOLDER" ]; then
rm -r "$TARGET_FOLDER"/* rm -r "$TARGET_FOLDER"
else
mkdir -p "$TARGET_FOLDER"
fi fi
mkdir -p "$TARGET_FOLDER"
# Download the file # Download the file
echo "⏳ Trying to download the file..." echo "⏳ Trying to download the file..."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment