Merge pull request #185 from amiaopensource/update-load-script

add query for default browser
This commit is contained in:
Reto Kromer 2017-05-09 19:30:27 +02:00 committed by GitHub
commit 3f76abc053

View File

@ -1,13 +1,18 @@
#!/usr/bin/env bash #!/usr/bin/env bash
if [[ $OSTYPE = darwin* ]] ; then if [[ $OSTYPE = 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 [ -d /usr/local/Cellar/ffmprovisr ] ; then if [ -d /usr/local/Cellar/ffmprovisr ] ; then
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 [ -z "${ffmprovisr_path}" ] ; then if [ -z "${ffmprovisr_path}" ] ; then
ffmprovisr_path='https://amiaopensource.github.io/ffmprovisr/' ffmprovisr_path='https://amiaopensource.github.io/ffmprovisr/'
fi fi
if [ -n "${default_browser}" ] ; then
open -b "${default_browser}" "${ffmprovisr_path}"
else
open "${ffmprovisr_path}" open "${ffmprovisr_path}"
fi
elif [[ $OSTYPE = linux-gnu ]] ; then elif [[ $OSTYPE = linux-gnu ]] ; then
if [ -d ~/.linuxbrew/Cellar/ffmprovisr ] ; then if [ -d ~/.linuxbrew/Cellar/ffmprovisr ] ; then
ffmprovisr_path=$(find ~/.linuxbrew/Cellar/ffmprovisr -iname 'index.html' | sort -M | tail -n1) ffmprovisr_path=$(find ~/.linuxbrew/Cellar/ffmprovisr -iname 'index.html' | sort -M | tail -n1)