Skip to content

Commit

Permalink
Add up_deps.jl script
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriabarra committed Aug 22, 2023
1 parent d17688e commit 2b3915d
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .dev/up_deps.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#=
A simple script for updating the manifest
files in all of our environments.
=#

root = dirname(@__DIR__)
dirs = (
root,
joinpath(root, "artifacts"),
joinpath(root, "test"),
joinpath(root, ".dev"),
joinpath(root, "perf"),
joinpath(root, "docs"),
joinpath(root, "experiments/AMIP/modular"),
)

cd(root) do
for dir in dirs
reldir = relpath(dir, root)
@info "Updating environment `$reldir`"
cmd = if dir == root
`$(Base.julia_cmd()) --project -e """import Pkg; Pkg.update()"""`
elseif dir == joinpath(root, ".dev")
`$(Base.julia_cmd()) --project=$reldir -e """import Pkg; Pkg.update()"""`
else
`$(Base.julia_cmd()) --project=$reldir -e """import Pkg; Pkg.develop(;path=\".\"); Pkg.update()"""`
end
run(cmd)
end
end

# https://github.com/JuliaLang/Pkg.jl/issues/3014
for dir in dirs
cd(dir) do
rm("LocalPreferences.toml"; force = true)
end
end

0 comments on commit 2b3915d

Please sign in to comment.