diff --git a/.dev/up_deps.jl b/.dev/up_deps.jl new file mode 100644 index 0000000000..9e874f4e89 --- /dev/null +++ b/.dev/up_deps.jl @@ -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