Skip to content

Commit

Permalink
Merge pull request #51 from retokromer/patch-1
Browse files Browse the repository at this point in the history
don't try to find the default browser on macOS
  • Loading branch information
Ethan Gates authored Jul 26, 2021
2 parents 71ca32e + 79aaa1f commit f6cc2ec
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 f6cc2ec

Please sign in to comment.