Skip to content

Commit 05d73a0

Browse files
committed
Fixes a bug that was only in the windows version
On windows command output wasn't displayed
1 parent e30037e commit 05d73a0

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dotree"
3-
version = "0.5.1"
3+
version = "0.5.2"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

dotree.dt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ menu root {
55
cargo test
66
"!
77
r: "Make release" - "./mk-release.bash"
8+
w: "build windows" - !"
9+
cargo build --release --target=x86_64-pc-windows-gnu
10+
strip target/x86_64-pc-windows-gnu/release/dt.exe
11+
"!
812
}

src/core.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,12 @@ fn exec_cmd<'a>(shell_name: &'a str, mut args: Vec<&'a str>) -> Result<()> {
164164
#[cfg(windows)]
165165
fn exec_cmd(shell_name: &str, args: Vec<&str>) -> Result<()> {
166166
// windows doesn't have an exec, let's do this instead
167-
run_subcommand(shell_name, &args, false)?;
168-
std::process::exit(0);
167+
let status = std::process::Command::new(shell_name).args(args).status()?;
168+
if !status.success() {
169+
Err(anyhow!("Process didn't exit successfully: {status:?}"))
170+
} else {
171+
std::process::exit(0);
172+
}
169173
}
170174

171175
fn run_subcommand(prog: &str, args: &[&str], ignore_result: bool) -> Result<()> {

0 commit comments

Comments
 (0)