Skip to content

Conversation

@trulede
Copy link
Contributor

@trulede trulede commented Jan 8, 2026

When commands from coreutils fail, the error type is not the expected interop.ExitStatus. The handling of those errors, especially in relation to ignore-error, depends on that error type.

Solution presented here first prints the error (otherwise you have no feedback as to why the command fails), and then replaces the err object with a new interop.ExitStatus error. Location is also chosen because logging is available (for the original error).

Output formatting of the error is similar (in format) to the errors from defaul interop.

# Windows
.\task.exe -t .\ISSUES\2466 -v
task: "default" started
task: [default] cp -f foo fuvar/bar
CreateFile \\wsl.localhost\Ubuntu\home\trule\git\task\ISSUES\2466\foo: The system cannot find the file specified.
task: [default] command error ignored: exit status 1
task: "default" finished

# Linux
$ task -t ./ISSUES/2466/ -v
task: "default" started
task: [default] cp -f foo fuvar/bar
cp: cannot stat 'foo': No such file or directory
task: [default] command error ignored: exit status 1
task: "default" finished

Fixes #2466

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ignore_error not working on new built-in cp command

1 participant