Created
June 9, 2020 18:04
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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