-
Notifications
You must be signed in to change notification settings - Fork 7
Bug: stderr.is_empty() check causes false negatives #20
Copy link
Copy link
Open
Description
Description
In src/linux.rs (run_command) and src/macos.rs (invoke_script), the success check requires both output.status.success() and output.stderr.is_empty():
if output.status.success() && output.stderr.is_empty() {
return Ok(());
}Many system commands legitimately write warnings or informational messages to stderr even when they execute successfully. This causes valid operations to be reported as failures.
Suggested fix
Trust the exit status code alone:
if output.status.success() {
return Ok(());
}If stderr content is still needed, include it only in the error case:
if output.status.success() {
return Ok(());
}
Err(Error::new(
ErrorKind::Other,
String::from_utf8_lossy(&output.stderr).into_owned(),
))Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels