Provide default icon URL if none given in omarchy-webapp-install (#4650)
This commit is contained in:
@@ -6,7 +6,7 @@ if [ "$#" -lt 3 ]; then
|
|||||||
echo -e "\e[32mLet's create a new web app you can start with the app launcher.\n\e[0m"
|
echo -e "\e[32mLet's create a new web app you can start with the app launcher.\n\e[0m"
|
||||||
APP_NAME=$(gum input --prompt "Name> " --placeholder "My favorite web app")
|
APP_NAME=$(gum input --prompt "Name> " --placeholder "My favorite web app")
|
||||||
APP_URL=$(gum input --prompt "URL> " --placeholder "https://example.com")
|
APP_URL=$(gum input --prompt "URL> " --placeholder "https://example.com")
|
||||||
ICON_REF=$(gum input --prompt "Icon URL> " --placeholder "See https://dashboardicons.com (must use PNG!)")
|
ICON_REF=$(gum input --prompt "Icon URL> " --placeholder "See https://dashboardicons.com (must use PNG or leave blank to use the default web app icon)")
|
||||||
CUSTOM_EXEC=""
|
CUSTOM_EXEC=""
|
||||||
MIME_TYPES=""
|
MIME_TYPES=""
|
||||||
INTERACTIVE_MODE=true
|
INTERACTIVE_MODE=true
|
||||||
@@ -19,6 +19,10 @@ else
|
|||||||
INTERACTIVE_MODE=false
|
INTERACTIVE_MODE=false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$ICON_REF" ]]; then
|
||||||
|
ICON_REF="https://www.google.com/s2/favicons?domain=${APP_URL}&sz=128"
|
||||||
|
fi
|
||||||
|
|
||||||
# Ensure valid execution
|
# Ensure valid execution
|
||||||
if [[ -z "$APP_NAME" || -z "$APP_URL" || -z "$ICON_REF" ]]; then
|
if [[ -z "$APP_NAME" || -z "$APP_URL" || -z "$ICON_REF" ]]; then
|
||||||
echo "You must set app name, app URL, and icon URL!"
|
echo "You must set app name, app URL, and icon URL!"
|
||||||
|
|||||||
Reference in New Issue
Block a user