google_chrome: Fix browser detection on MacOS

This commit is contained in:
Timo Makinen 2022-08-02 06:35:47 +00:00
parent e5782cef9b
commit a3e0947e54
2 changed files with 4 additions and 6 deletions

View file

@ -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"

View file

@ -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"