Description
Testing out the new Built-in Core Utilities I ran into an issue.
When executing statement like cat doesnotexist || echo "test" on linux, it will correctly catch the cat command's error state and execute the next command: echo "test".
cat: can't open 'doesnotexist': No such file or directory
test
When using the built-in utilities, it will fatally exit out of the statement
task: [example] cat doesnotexist || echo "non-catastrophic"
task: Failed to run task "example": coreutils: open [....]/doesnotexist: The system cannot find the file specified.
It exits out of the statement in such a way that not even ignore_error can handle it correctly.
The example Taskfile output on Windows:
Note that ignore_error did not work and the || statement did not execute.
task: [example] false
task: [example] false || echo "non-catastrophic"
non-catastrophic
task: [example] base64 doesnotexist || echo "non-catastrophic"
task: Failed to run task "example": coreutils: open C:\[....]\doesnotexist: The system cannot find the file specified.
The example Taskfile on Linux:
Note all statement act normally
task: [example] false
task: [example] false || echo "non-catastrophic"
non-catastrophic
task: [example] base64 doesnotexist || echo "non-catastrophic"
base64: doesnotexist: No such file or directory
non-catastrophic
task: [example] cat doesnotexist || echo "non-catastrophic"
cat: can't open 'doesnotexist': No such file or directory
non-catastrophic
Using TASK_CORE_UTILS=1 go-task example on linux
Note that ignore_error did not work and the || statement did not execute when using the built-in utilities.
task: [example] false
task: [example] false || echo "non-catastrophic"
non-catastrophic
task: [example] base64 doesnotexist || echo "non-catastrophic"
task: Failed to run task "example": open /[....]/doesnotexist: no such file or directory
Version
3.48.0-windows, 3.45.5-alpine
Operating system
Windows, Linux (alpine)
Experiments Enabled
No response
Example Taskfile
version: '3'
tasks:
example:
desc: "Catastrophic failure of built-in utils"
cmds:
- cmd: 'false'
ignore_error: true
- cmd: 'false || echo "non-catastrophic"'
- cmd: 'base64 doesnotexist || echo "non-catastrophic"'
ignore_error: true
- cmd: 'cat doesnotexist || echo "non-catastrophic"'
Description
Testing out the new Built-in Core Utilities I ran into an issue.
When executing statement like
cat doesnotexist || echo "test"on linux, it will correctly catch thecatcommand's error state and execute the next command:echo "test".When using the built-in utilities, it will fatally exit out of the statement
It exits out of the statement in such a way that not even
ignore_errorcan handle it correctly.The example Taskfile output on Windows:
Note that
ignore_errordid not work and the||statement did not execute.The example Taskfile on Linux:
Note all statement act normally
Using
TASK_CORE_UTILS=1 go-task exampleon linuxNote that
ignore_errordid not work and the||statement did not execute when using the built-in utilities.Version
3.48.0-windows, 3.45.5-alpine
Operating system
Windows, Linux (alpine)
Experiments Enabled
No response
Example Taskfile