Nuzair46 / BlockTheSpot-Mac

Spotify Ad blocker for MacOS
GNU General Public License v3.0
1.43k stars 89 forks source link

install.sh: fix version check by using Aplle's official plist parsing tool #85

Open MaEtUgR opened 4 days ago

MaEtUgR commented 4 days ago

Problem

image

Solution

I hadn't seen https://github.com/Nuzair46/BlockTheSpot-Mac/pull/83 and figured out how to properly parse a plist file on the terminal without bash hackery: defaults read "/Applications/Spotify.app/Contents/Info.plist" CFBundleVersion This solution should hold up for much longer without braking since I'm using Apple's official parsing tool.

Until this gets merged just change line 85 of install.sh from CLIENT_VERSION=$(awk '/CFBundleShortVersionString/{getline; print}' "${INSTALL_PATH}/Contents/Info.plist" | cut -d\> -f2- | rev | cut -d. -f2- | rev) to CLIENT_VERSION=$(defaults read "${INSTALL_PATH}/Contents/Info.plist" CFBundleVersion)