Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Create a Julia Project file that pins all packages to the version in the manifest
using Pkg, Pkg.TOML
manifest = open(joinpath(dir, "Manifest.toml")) do io
TOML.parse(io)
end
open(joinpath(dir, "Project-tmp.toml"), "w") do io
println(io, "[deps]")
for pkg in keys(manifest)
println(io, pkg, " = \"", manifest[pkg][1]["uuid"], "\"")
end
println(io)
println(io, "[compat]")
for pkg in keys(manifest)
if haskey(manifest[pkg][1], "version")
println(io, pkg, " = \"=", manifest[pkg][1]["version"], "\"")
end
end
println(io, "julia = \"=1.0.4\"")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.