Closed codingCoffee closed 3 weeks ago
I am not certain that nom should change it’s behavior.
When using nom in wrapper mode we do forward the exit code. But in pipe mode we don’t and I am not sure we can.
My recommendation would be to activate something like pipefail in the shell. I don’t see that nom should be erroring here, nom didn’t fail. And there are certainly possible failures of nixos-rebuild which nom couldn’t even detect.
As a workaround for #68 maybe try out: https://github.com/viperML/nh
Ahh! I was missing the pipefail. My bad!
For example when running
the
nixos-rebuild
command fails, because it doesn't havesudo
permission. However, the output of the entire command suceeds because of piping the output tonom
.I came across this issue while trying to find a workaround for https://github.com/maralorn/nix-output-monitor/issues/68
Also when there is any kind of build failure, nom returns a success response, which makes a little difficult to use in scripts. Maybe somehow piping the exit code of the command preceeding
nom
asnom
's exit code might do the trick?