From a3e0947e54338ec9723935947c0f721cb56cc5eb Mon Sep 17 00:00:00 2001 From: Timo Makinen Date: Tue, 2 Aug 2022 06:35:47 +0000 Subject: [PATCH] google_chrome: Fix browser detection on MacOS --- google_chrome/files/google-chrome-incognito.sh | 5 ++--- google_chrome/files/google-chrome-socksproxy.sh | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/google_chrome/files/google-chrome-incognito.sh b/google_chrome/files/google-chrome-incognito.sh index 1bad5bf..5925786 100755 --- a/google_chrome/files/google-chrome-incognito.sh +++ b/google_chrome/files/google-chrome-incognito.sh @@ -4,9 +4,8 @@ set -eu URL="${2-}" -CHROME="$(which google-chrome 2>/dev/null)" -if [ -z "$CHROME" ]; then - if [ -f "/Applications/Google Chrome.app" ]; then +if ! CHROME="$(which google-chrome 2>/dev/null)"; then + if [ -d "/Applications/Google Chrome.app" ]; then CHROME="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" else echo "ERR: Failed to find Google Chrome installation" diff --git a/google_chrome/files/google-chrome-socksproxy.sh b/google_chrome/files/google-chrome-socksproxy.sh index 7871490..8f6a7de 100755 --- a/google_chrome/files/google-chrome-socksproxy.sh +++ b/google_chrome/files/google-chrome-socksproxy.sh @@ -10,9 +10,8 @@ fi SOCKSPORT="$1" URL="${2-}" -CHROME="$(which google-chrome 2>/dev/null)" -if [ -z "$CHROME" ]; then - if [ -f "/Applications/Google Chrome.app" ]; then +if ! CHROME="$(which google-chrome 2>/dev/null)"; then + if [ -d "/Applications/Google Chrome.app" ]; then CHROME="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" else echo "ERR: Failed to find Google Chrome installation"