File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 1- # Vendored from Pluto.jl#src/notebook/path helpers.jl
2- # from https://github.com/JuliaLang/julia/pull/36425
3- function detectwsl ()
4- Sys. islinux () &&
5- isfile (" /proc/sys/kernel/osrelease" ) &&
6- occursin (r" Microsoft|WSL" i , read (" /proc/sys/kernel/osrelease" , String))
1+ @static if isdefined (Sys, :detectwsl )
2+ const detectwsl = Sys. detectwsl
3+ else
4+ # Borrowed from Julia (MIT license)
5+ # https://github.com/JuliaLang/julia/blob/726c816b9590d748345fb615b76b685c79eafd0d/base/sysinfo.jl#L549-L555
6+ # https://github.com/JuliaLang/julia/pull/57069
7+ function detectwsl ()
8+ # We use the same approach as canonical/snapd do to detect WSL
9+ islinux () && (
10+ isfile (" /proc/sys/fs/binfmt_misc/WSLInterop" )
11+ || isdir (" /run/WSL" )
12+ )
13+ end
714end
You can’t perform that action at this time.
0 commit comments