-
-
Notifications
You must be signed in to change notification settings - Fork 793
Closed as duplicate of#2466
Closed as duplicate of#2466
Copy link
Labels
dep: u-root/u-rootIssues related to the upstream core utils used by Task.Issues related to the upstream core utils used by Task.
Description
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
testWhen 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-catastrophicUsing 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 directoryVersion
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"'Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
dep: u-root/u-rootIssues related to the upstream core utils used by Task.Issues related to the upstream core utils used by Task.