Skip to content

Commit

Permalink
don't try to find the default browser on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
retokromer authored Jul 4, 2021
1 parent 71ca32e commit 79aaa1f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions cable-bible
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,12 @@
# is connected to the Web, and the local version otherwise.

if [[ "$(uname -s)" = "Darwin" ]] ; then
default_browser=$(plutil -convert json ~/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist -r -o - | grep https -b1 | tail -n1 | cut -d'"' -f4)
if ping -c 1 amiaopensource.github.io >/dev/null 2>&1 ; then
cablebible_path='https://amiaopensource.github.io/cable-bible/'
else
cablebible_path=$(find /usr/local/Cellar/cable-bible -iname 'index.html' | sort -M | tail -n1)
fi
if [ -n "${default_browser}" ] ; then
open -b "${default_browser}" "${cablebible_path}"
else
open "${cablebible_path}"
fi
open "${cablebible_path}"
elif [[ "$(uname -s)" = "Linux" ]] ; then
if ping -c 1 amiaopensource.github.io >/dev/null 2>&1 ; then
cablebible_path='https://amiaopensource.github.io/cable-bible/'
Expand Down

0 comments on commit 79aaa1f

Please sign in to comment.