don't try to find the default browser on macOS (#456)

This commit is contained in:
רטו • Reto 2021-08-13 19:53:57 +02:00 committed by GitHub
parent bf93a20da8
commit 0d27ffa5d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,17 +4,12 @@
# connected to the Web, and the local version otherwise. # connected to the Web, and the local version otherwise.
if [[ "$(uname -s)" = "Darwin" ]] ; then 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 if ping -c 1 amiaopensource.github.io >/dev/null 2>&1 ; then
ffmprovisr_path='https://amiaopensource.github.io/ffmprovisr/' ffmprovisr_path='https://amiaopensource.github.io/ffmprovisr/'
else else
ffmprovisr_path=$(find /usr/local/Cellar/ffmprovisr -iname 'index.html' | sort -M | tail -n1) ffmprovisr_path=$(find /usr/local/Cellar/ffmprovisr -iname 'index.html' | sort -M | tail -n1)
fi fi
if [[ -n "${default_browser}" ]] ; then open "${ffmprovisr_path}"
open -b "${default_browser}" "${ffmprovisr_path}"
else
open "${ffmprovisr_path}"
fi
elif [[ "$(uname -s)" = "Linux" ]] ; then elif [[ "$(uname -s)" = "Linux" ]] ; then
if ping -c 1 amiaopensource.github.io >/dev/null 2>&1 ; then if ping -c 1 amiaopensource.github.io >/dev/null 2>&1 ; then
ffmprovisr_path='https://amiaopensource.github.io/ffmprovisr/' ffmprovisr_path='https://amiaopensource.github.io/ffmprovisr/'