mirror of
https://github.com/paulirish/git-open.git
synced 2026-09-10 07:26:15 -04:00
Merge pull request #132 from neersighted/patch-1
Remove openopt, allow spaces in $BROWSER
This commit is contained in:
commit
301c5a619e
11
git-open
11
git-open
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue