Don't blindly assume the last-system.
As it was we assumed that any system that wasn't Windows or OS X must be Linux but the reality of that can be very unlikely. BSD is popular in some places and it's not Linux and this would cause an error there. If we do not know the launcher for a platform we should ship an error and have the user file a bug if they feel it necessary and skip the launch otherwise.
This commit is contained in:
parent
f2aa15555b
commit
06ab708edf
|
@ -127,15 +127,12 @@ module Jekyll
|
||||||
|
|
||||||
private
|
private
|
||||||
def launch_browser(server, opts)
|
def launch_browser(server, opts)
|
||||||
command =
|
address = server_address(server, opts)
|
||||||
if Utils::Platforms.windows?
|
return system "start", address if Utils::Platforms.windows?
|
||||||
"start"
|
return system "xdg-open", address if Utils::Platforms.linux?
|
||||||
elsif Utils::Platforms.osx?
|
return system "open", address if Utils::Platforms.osx?
|
||||||
"open"
|
Jekyll.logger.error "Refusing to launch browser; " \
|
||||||
else
|
"Platform launcher unknown."
|
||||||
"xdg-open"
|
|
||||||
end
|
|
||||||
system command, server_address(server, opts)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Keep in our area with a thread or detach the server as requested
|
# Keep in our area with a thread or detach the server as requested
|
||||||
|
|
Loading…
Reference in New Issue