| Crates.io | cross-exec |
| lib.rs | cross-exec |
| version | 0.1.1 |
| created_at | 2026-01-21 18:19:34.627453+00 |
| updated_at | 2026-01-21 18:23:38.342094+00 |
| description | ⚡️ Unix CommandExt::exec but isomorphic |
| homepage | https://docs.rs/cross-exec |
| repository | https://github.com/jcbhmr/cross-exec-rs |
| max_upload_size | |
| id | 2059823 |
| size | 13,128 |
exec for Rust⚡️ Unix CommandExt::exec but isomorphic
|
🟦 Emulates process replacement behaviour on Windows
🐧 Uses native CommandExt::exec on Unix
cargo add cross-exec
Use .cross_exec() on a std::process::Command just like you would use .exec() on Unix.
use cross_exec::CommandExt;
use std::process::Command;
use std::error::Error;
fn main() -> Result<(), Box<dyn Error>> {
let err = Command::new("cargo")
.arg("--version")
.cross_exec();
Err(err.into())
}
Why?
I wanted a cross-platform way to replace the current process with a new one for wrapper programs that just end up calling another program at the end.
This project is based on the exec_replace function from cargo-util.