mirror of
https://github.com/Nuzair46/SpotX-Linux.git
synced 2024-10-22 20:47:01 -06:00
Additional Spotify Directory Detection (#13)
- add exclusions and additional conditions/searching when Spotify PATH set to /usr/bin
This commit is contained in:
parent
1e309cf468
commit
8240a1d884
12
install.sh
12
install.sh
|
@ -37,14 +37,22 @@ echo
|
|||
# Locate install directory
|
||||
if [ -z ${INSTALL_PATH+x} ]; then
|
||||
INSTALL_PATH=$(readlink -e `type -p spotify` 2>/dev/null | rev | cut -d/ -f2- | rev)
|
||||
if [[ -d "${INSTALL_PATH}" ]]; then
|
||||
if [[ -d "${INSTALL_PATH}" && "${INSTALL_PATH}" != "/usr/bin" ]]; then
|
||||
echo "Spotify directory found in PATH: ${INSTALL_PATH}"
|
||||
elif [[ ! -d "${INSTALL_PATH}" ]]; then
|
||||
echo -e "\nSpotify not found in PATH. Searching for Spotify directory..."
|
||||
INSTALL_PATH=$(timeout 10 find / -type f -path "*/spotify/Apps/*" -name "xpui.spa" -size -7M -size +3M -print -quit 2>/dev/null | rev | cut -d/ -f3- | rev)
|
||||
INSTALL_PATH=$(timeout 10 find / -type f -path "*/spotify*Apps/*" -name "xpui.spa" -size -7M -size +3M -print -quit 2>/dev/null | rev | cut -d/ -f3- | rev)
|
||||
if [[ -d "${INSTALL_PATH}" ]]; then
|
||||
echo "Spotify directory found: ${INSTALL_PATH}"
|
||||
elif [[ ! -d "${INSTALL_PATH}" ]]; then
|
||||
echo -e "Spotify directory not found. Set directory path with -P flag.\nExiting...\n"
|
||||
exit; fi
|
||||
elif [[ "${INSTALL_PATH}" == "/usr/bin" ]]; then
|
||||
echo -e "\nSpotify PATH is set to /usr/bin, searching for Spotify directory..."
|
||||
INSTALL_PATH=$(timeout 10 find / -type f -path "*/spotify*Apps/*" -name "xpui.spa" -size -7M -size +3M -print -quit 2>/dev/null | rev | cut -d/ -f3- | rev)
|
||||
if [[ -d "${INSTALL_PATH}" && "${INSTALL_PATH}" != "/usr/bin" ]]; then
|
||||
echo "Spotify directory found: ${INSTALL_PATH}"
|
||||
elif [[ "${INSTALL_PATH}" == "/usr/bin" ]] || [[ ! -d "${INSTALL_PATH}" ]]; then
|
||||
echo -e "Spotify directory not found. Set directory path with -P flag.\nExiting...\n"
|
||||
exit; fi; fi
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue
Block a user