From f4ae675e8c817b7dc9b34e0a715ccabbd81d6222 Mon Sep 17 00:00:00 2001 From: jetfir3 <95306468+jetfir3@users.noreply.github.com> Date: Wed, 6 Mar 2024 15:18:42 -0500 Subject: [PATCH] Add additional Snap handling --- spotx.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/spotx.sh b/spotx.sh index eaad7eb..802eb69 100644 --- a/spotx.sh +++ b/spotx.sh @@ -179,14 +179,19 @@ linux_search_path () { return 1 } +linux_snap_check () { + command -v snap >/dev/null && snap list spotify &>/dev/null && + { echo -e "${red}Error:${clear} Snap client not supported. See FAQ for more info.\nIf another Spotify package is installed, set directory path with '-P' flag.\n" >&2; exit 1; } || + { echo -e "${red}Error:${clear} Spotify directory not found.\nSet directory path with '-P' flag.\n" >&2; exit 1; } +} + linux_set_path () { if [[ "${installDeb}" ]]; then linux_deb_prepare elif [[ -z "${installPath+x}" ]]; then echo -e "Searching for Spotify directory...\n" linux_search_path - [[ -d "${installPath}" ]] && echo -e "Found Spotify Directory: ${installPath}\n" || - { echo -e "${red}Error:${clear} Spotify directory not found.\nSet directory path with '-P' flag.\n" >&2; exit 1; } + [[ -d "${installPath}" ]] && echo -e "Found Spotify Directory: ${installPath}\n" || linux_snap_check else { [[ "${installPath}" == *"snapd/snap"* ]] || [[ "${installPath}" == *"snap/spotify"* ]] || [[ "${installPath}" == *"snap/bin"* ]]; } && { echo -e "${red}Error:${clear} Snap client not supported. See FAQ for more info.\n" >&2; exit 1; } [[ -f "${installPath}/Apps/xpui.spa" ]] && echo -e "Using Spotify Directory: ${installPath}\n" ||