EmbarkStudios / EmbarkStudios/cargo-about
Create parent output directory automatically if missing
- Dominant language
- Rust
- Stars
- 782
- Forks
- 46
- Avg merge
- 13m
- Merged PRs (30d)
- 1
Description
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. When running `cargo about -o "./target/licenses.html"` I need to ensure that the `target` directory is already present.
(This is not really an issue for us, but on the other hand probably a low-hanging-fruit 😄 )
**Describe the solution you'd like**
I would expect a idempotent call to create the directory if the (parent) directory is missing (think of `mkdir -p`). It seems that other tooling which contribute to Rust's `target` directory behaves the same (e.g. `cargo build` itself).
**Describe alternatives you've considered**
Workaround: Create the parent directory within CI/make tooling. Especially for the example `target` this is done implicitly through `cargo build`.
**Additional context**
Issue which occurs when executing `cargo about` without executing `cargo build` before.
```sh
[cargo-make] INFO - Execute Command: "cargo" "about" "-L" "error" "generate" "--workspace" "-o" "./target/licenses.html" "about.hbs"
2025-03-20 8:56:50.274202935 +00:00:00 [ERROR] output file ./target/licenses.html could not be written: No such file or directory (os error 2)
Error while executing command, exit code: 1
```
Contributor guide
Assessment
This issue has not been assessed yet.