os.rb: fix for WSL systems without wslview
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
5dbf95958b
commit
3e6fc271c4
@ -69,7 +69,11 @@ module OS
|
|||||||
elsif OS.linux?
|
elsif OS.linux?
|
||||||
require "os/linux"
|
require "os/linux"
|
||||||
ISSUES_URL = "https://docs.brew.sh/Troubleshooting"
|
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
|
end
|
||||||
|
|
||||||
sig { returns(T::Boolean) }
|
sig { returns(T::Boolean) }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user