How to detect workspaces within a directory via CLI?

โš“ Rust    ๐Ÿ“… 2025-07-29    ๐Ÿ‘ค surdeus    ๐Ÿ‘๏ธ 10      

surdeus

Warning

This post was published 127 days ago. The information described in this article may have changed.

I have a repo containing a number of workspaces, and I have some CI actions that require handling each workspace. Is there a good way to identify all workspaces contained within this directory from a CLI command?

My best solution so far is rg -.cttoml '^[workspace([.].*)?]$' | cut -d: -f1 (gets all toml files with a top-level workspace key), which will detect every workspace but which could also detect miscellaneous other toml files (I donโ€™t think crate Cargo.toml files can break this, but my repo also has other toml files for configuration etc.).

4 posts - 2 participants

Read full topic

๐Ÿท๏ธ Rust_feed