Closed
Description
Hello, I'm currently trying to migrate from some build.sh
and build.ps1
files to a magefile using script
.
Maybe I misunderstood the purpose of Error()
, but when I don't need the output of a command (as String()
would return), I thought Error()
would basically ignore the output, but still return the error. But it seems that when chained after an ExecForEach
, the commands in that are not executed.
For example, let's say we have files coverage.txt
and foo/coverage.txt
and I want to remove them.
Then the following works:
_, err := script.FindFiles(".").Match("coverage.txt").ExecForEach("rm ./{{.}}").String()
return err
But the following doesn't:
return script.FindFiles(".").Match("coverage.txt").ExecForEach("rm ./{{.}}").Error()
Is that expected?
Metadata
Metadata
Assignees
Labels
No labels