2023-10-20 08:10:26 +01:00
|
|
|
# cargo locate-project
|
|
|
|
|
2024-02-14 20:25:13 +00:00
|
|
|
> Print the full path to the `Cargo.toml` manifest of a project.
|
2023-10-20 08:10:26 +01:00
|
|
|
> If the project is part of a workspace, the manifest of the project is shown, rather than that of the workspace.
|
|
|
|
> More information: <https://doc.rust-lang.org/cargo/commands/cargo-locate-project.html>.
|
|
|
|
|
2024-02-14 20:25:13 +00:00
|
|
|
- Display the JSON object with full path to the `Cargo.toml` manifest:
|
2023-10-20 08:10:26 +01:00
|
|
|
|
|
|
|
`cargo locate-project`
|
|
|
|
|
2024-02-14 20:25:13 +00:00
|
|
|
- Display the project path in the specified format:
|
2023-10-20 08:10:26 +01:00
|
|
|
|
|
|
|
`cargo locate-project --message-format {{plain|json}}`
|
|
|
|
|
2024-02-14 20:25:13 +00:00
|
|
|
- Display the `Cargo.toml` manifest located at the root of the workspace as opposed to the current workspace member:
|
2023-10-20 08:10:26 +01:00
|
|
|
|
|
|
|
`cargo locate-project --workspace`
|
2024-02-14 20:25:13 +00:00
|
|
|
|
|
|
|
- Display the `Cargo.toml` manifest of a specific directory:
|
|
|
|
|
|
|
|
`cargo locate-project --manifest-path {{path/to/Cargo.toml}}`
|