Add exec command for Windows (#11001)

# Description
Based of the work and discussion in #10844, this PR adds the `exec`
command for Windows. This is done by simply spawning a
`std::process::Command` and then immediately exiting via
`std::process::exit` once the child process is finished. The child
process's exit code is passed to `exit`.

# User-Facing Changes
The `exec` command is now available on Windows, and there should be no
change in behaviour for Unix systems.
This commit is contained in:
Ian Manske
2023-11-08 20:50:25 +00:00
committed by GitHub
parent 59ea28cf06
commit 1fd3bc1ba6
4 changed files with 41 additions and 33 deletions

View File

@ -1,5 +1,4 @@
mod complete;
#[cfg(unix)]
mod exec;
mod nu_check;
#[cfg(any(
@ -16,7 +15,6 @@ mod sys;
mod which_;
pub use complete::Complete;
#[cfg(unix)]
pub use exec::Exec;
pub use nu_check::NuCheck;
#[cfg(any(