Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix missing Sys. in detectwsl #39

Merged
merged 2 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PkgAuthentication"
uuid = "4722fa14-9d28-45f9-a1e2-a38605bd88f0"
authors = ["Sebastian Pfitzner", "contributors"]
version = "2.1.0"
version = "2.1.1"

[deps]
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
Expand Down
2 changes: 1 addition & 1 deletion src/helpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ else
# https://github.com/JuliaLang/julia/pull/57069
function detectwsl()
# We use the same approach as canonical/snapd do to detect WSL
islinux() && (
Sys.islinux() && (
isfile("/proc/sys/fs/binfmt_misc/WSLInterop")
|| isdir("/run/WSL")
)
Expand Down
2 changes: 2 additions & 0 deletions test/utilities_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
@test PkgAuthentication.assert_dict_keys(Dict("bar" => 0), "foo", "bar"; msg="") === nothing
@test_throws ErrorException PkgAuthentication.assert_dict_keys(Dict(), "foo", "bar"; msg="")
@test_throws ErrorException PkgAuthentication.assert_dict_keys(Dict("baz" => 0), "foo", "bar"; msg="")

@test PkgAuthentication.detectwsl() isa Bool
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test is a bit contrived, but this should at least exercise the code path now.

end
Loading