Skip to content

Commit

Permalink
Do-block mktemp in _find_ambiguities
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub committed Aug 25, 2023
1 parent c6fab8a commit 64547be
Showing 1 changed file with 12 additions and 11 deletions.
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

0 comments on commit 64547be

Please sign in to comment.