Fix download with proper path

This commit is contained in:
David Heinemeier Hansson
2025-09-17 10:12:15 +02:00
parent b5b4dea4ff
commit f592bca968

View File

@@ -24,7 +24,9 @@ if [[ -z "$APP_NAME" || -z "$APP_URL" || -z "$ICON_REF" ]]; then
fi
# Refer to local icon or fetch remotely from URL
ICON_DIR="$HOME/.local/share/applications/icons"
if [[ $ICON_REF =~ ^https?:// ]]; then
ICON_PATH="$ICON_DIR/$APP_NAME.png"
if curl -sL -o "$ICON_PATH" "$ICON_REF"; then
ICON_PATH="$ICON_DIR/$APP_NAME.png"
else
@@ -32,7 +34,7 @@ if [[ $ICON_REF =~ ^https?:// ]]; then
exit 1
fi
else
ICON_PATH="$HOME/.local/share/applications/icons/$ICON_REF"
ICON_PATH="$ICON_DIR/$ICON_REF"
fi
# Use custom exec if provided, otherwise default behavior