Skip to content

Commit

Permalink
Eliminate the offer to interactively add packages
Browse files Browse the repository at this point in the history
I haven't seen this warning come up in a long time, so I don't think
this code is active. It adds significant latency due to the time
needed to infer the Pkg calls, so let's ditch it.

xref #226.
  • Loading branch information
timholy committed Dec 31, 2020
1 parent 35d62f6 commit 6f009f0
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/error_handling.jl
Expand Up @@ -83,20 +83,5 @@ handle_error(e, q) = throw(e)

function handle_error(e::NotInstalledError, q)
println("Library \"", e.library, "\" is not installed but is recommended as a library to load format: \"", file_extension(q), "\"")
!isinteractive() && rethrow(e) # if we're not in interactive mode just throw
while true
println("Should we install \"", e.library, "\" for you? (y/n):")
input = lowercase(chomp(strip(readline(stdin))))
if input == "y"
@info(string("Start installing ", e.library, "..."))
Pkg.add(string(e.library))
return false # don't continue
elseif input == "n"
@info(string("Not installing ", e.library))
return true # User does not install, continue going through errors.
else
println("$input is not a valid choice. Try typing y or n")
end
end
true # User does not install, continue going through errors.
rethrow(e)
end

0 comments on commit 6f009f0

Please sign in to comment.