Merge pull request #14865 from maxim-belkin/wslview-fix

os.rb: fix for WSL systems without wslview
This commit is contained in:
Mike McQuaid 2023-03-03 09:32:10 +00:00 committed by GitHub
commit fa09365b3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,7 +69,11 @@ module OS
elsif OS.linux?
require "os/linux"
ISSUES_URL = "https://docs.brew.sh/Troubleshooting"
PATH_OPEN = (OS::Linux.wsl? ? "wslview" : "xdg-open").freeze
PATH_OPEN = if OS::Linux.wsl? && (wslview = which("wslview").presence)
wslview.to_s
else
"xdg-open"
end.freeze
end
sig { returns(T::Boolean) }