Use open instead of osascript in help

Work around a macOS osascript bug in 10.12.5 which prevented help
from working. Fixes #4035.
This commit is contained in:
ridiculousfish 2017-05-27 23:35:18 -07:00 committed by David Adam
parent 9236e27e86
commit f234637e53

View file

@ -62,9 +62,14 @@ function help --description 'Show help for the fish shell'
set fish_browser xdg-open
end
# On OS X, we go through osascript by default
# On OS X, we use osascript < 10.12.5, and open after (see #4035)
if test (uname) = Darwin
if type -q osascript
set -l version (sw_vers -productVersion | string split .) 0 0 0
if [ $version[1] -gt 10 ]
or [ $version[1] -eq 10 -a $version[2] -gt 12 ]
or [ $version[1] -eq 10 -a $version[2] -eq 12 -a $version[3] -ge 5 ]
set fish_browser open
else
set fish_browser osascript
end
end