Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Do-block in mktemp in _find_ambiguities #168

Merged
merged 1 commit into from
Aug 25, 2023
Merged
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
23 changes: 12 additions & 11 deletions src/ambiguities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,19 @@ function _find_ambiguities(
end
cmd = `$cmd --startup-file=no -e $code`

outfile, out = mktemp()
errfile, err = mktemp()
succ = success(pipeline(cmd; stdout = out, stderr = err))
strout = read(outfile, String)
strerr = read(errfile, String)
num_ambiguities = if succ
0
else
parse(Int, match(r"(\d+) ambiguities found", strout).captures[1])
mktemp() do outfile, out
mktemp() do errfile, err
succ = success(pipeline(cmd; stdout = out, stderr = err))
strout = read(outfile, String)
strerr = read(errfile, String)
num_ambiguities = if succ
0
else
parse(Int, match(r"(\d+) ambiguities found", strout).captures[1])
end
return num_ambiguities, strout, strerr
end
end

return num_ambiguities, strout, strerr
end

function reprpkgids(packages::Vector{PkgId})
Expand Down
Loading