Skip to content

Bug: stderr.is_empty() check causes false negatives #20

@fasuizu-br

Description

@fasuizu-br

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(),
))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions