# Updating with nested Project.toml

**URL:** https://discourse.julialang.org/t/updating-with-nested-project-toml/115574
**Category:** Package Management
**Created:** [June 12, 2024, 8:10pm UTC](https://discourse.julialang.org/t/updating-with-nested-project-toml/115574 "2024-06-12T20:10:02Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![maxkapur](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maxkapur/32/21208_2.png) [@maxkapur](https://discourse.julialang.org/u/maxkapur)
#### Post date: [June 12, 2024, 8:10pm UTC](https://discourse.julialang.org/t/updating-with-nested-project-toml/115574/1 "2024-06-12T20:10:02Z")

</div>

In the package I am developing, I follow the best practice of having a separate `Project.toml`, `test/Project.toml`, and `docs/Project.toml`.

Unfortunately, this means my dependency versions get out of sync if I run `]update` in the base project but not the others.

Is there a [“topgrade”](https://github.com/topgrade-rs/topgrade/) for Julia that automatically searches a directory subtree for `Project.toml`s and runs `]update`?

---

<div class="post-metadata">

### Author: ![david2658](https://avatars.discourse-cdn.com/v4/letter/d/0ea827/32.png) [@david2658](https://discourse.julialang.org/u/david2658)
#### Post date: [June 13, 2024, 11:31am UTC](https://discourse.julialang.org/t/updating-with-nested-project-toml/115574/2 "2024-06-13T11:31:38Z")

</div>

Hello,  
In Julia, you can create a custom script to update all Project.toml files in your directory tree. Use the Glob package to find all Project.toml files recursively and run Pkg.update() on each one. Here’s a brief script: [patient gateway login](https://www.mgh-patientgateway.com/)

```julia
using Pkg, Glob

function update_project(project_path)
    println("Updating project at $project_path")
    Pkg.activate(project_path)
    Pkg.update()
end

for project_file in glob("**/Project.toml", ".")
    update_project(dirname(project_file))
end

```

Save this as update\_all\_projects.jl and run it with julia update\_all\_projects.jl to keep all dependencies in sync.
