Merge pull request #132 from neersighted/patch-1

Remove openopt, allow spaces in $BROWSER
This commit is contained in:
Dave Wikoff 2018-11-22 20:11:25 -05:00 committed by GitHub
commit 301c5a619e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -235,21 +235,16 @@ case $( uname -s ) in
CYGWIN*) open='cygstart';;
*) # Try to detect WSL (Windows Subsystem for Linux)
if uname -r | grep -q Microsoft; then
open='powershell.exe'
openopt='Start'
open='powershell.exe Start'
else
open='xdg-open'
fi;;
esac
# Allow printing the url if BROWSER=echo
if [[ $BROWSER == "echo" ]]; then
openopt=''
else
if [[ $BROWSER != "echo" ]]; then
exec &>/dev/null
fi
# open it in a browser
${BROWSER:-$open} $openopt "$openurl"
unset openopt
${BROWSER:-$open} "$openurl"