Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
- add check for pre-existing macOS auto-update; remove if found
  • Loading branch information
jetfir3 authored May 23, 2024
1 parent 16f3226 commit 737e6db
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions spotx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,14 @@ macos_set_path() {
}
}

macos_autoupdate_check() {
autoupdatePath="${HOME}/Library/Application Support/Spotify/PersistentCache/Update"
[[ -d "${autoupdatePath}" && "$(ls -A "${autoupdatePath}")" ]] && {
rm -rf "${autoupdatePath}"/* 2>/dev/null
[[ "${debug}" ]] && echo -e "${green}Debug:${clr} Removed stock update waiting to be installed"
}
}

macos_prepare() {
macos_requirements_check
macos_set_version
Expand All @@ -200,9 +208,11 @@ macos_prepare() {
[[ "${installMac}" ]] && installClient='true' && downloadVer=$(echo "${fileVar}" | perl -ne '/-(\d+\.\d+\.\d+\.\d+)/ && print "$1"')
[[ "${downloadVer}" ]] && (($(ver "${downloadVer}") < $(ver "1.1.59.710"))) && { echo -e "${red}Error:${clr} ${downloadVer} not supported by SpotX-Bash\n" >&2; exit 1; }
macos_set_path
[[ "${debug}" ]] && echo -e "${green}Debug:${clr} Install directory: ${installOutput}\n"
macos_autoupdate_check
appPath="${installPath}/Spotify.app"
appBinary="${appPath}/Contents/MacOS/Spotify"
appBak="${appPath}/Contents/MacOS/Spotify.bak"
appBak="${appBinary}.bak"
cachePath="${HOME}/Library/Caches/com.spotify.client"
xpuiPath="${appPath}/Contents/Resources/Apps"
[[ "${skipCodesign}" ]] && echo -e "${yellow}Warning:${clr} Codesigning has been skipped.\n" >&2 || true
Expand Down Expand Up @@ -302,7 +312,7 @@ linux_prepare() {
linux_set_path
appPath="${installPath}"
appBinary="${appPath}/spotify"
appBak="${appPath}/spotify.bak"
appBak="${appBinary}.bak"
xpuiPath="${appPath}/Apps"
[[ -z "${cachePath}" ]] && cachePath=$(timeout 10 find / -type d -path "*cache/spotify*" -not -path "*snap/spotify*" -name "spotify" -print -quit 2>/dev/null)
[[ "${debug}" ]] && echo -e "${green}Debug:${clr} $(cat /etc/*release | grep PRETTY_NAME | cut -d '"' -f2)"
Expand Down

0 comments on commit 737e6db

Please sign in to comment.