Skip to content

Instantly share code, notes, and snippets.

@giordano
Created June 9, 2020 18:04
Show Gist options
  • Save giordano/355fc45fd4879138d054358ee4aa07b8 to your computer and use it in GitHub Desktop.
Save giordano/355fc45fd4879138d054358ee4aa07b8 to your computer and use it in GitHub Desktop.
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