Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: --exec-batch no longer preserves status code #1136

Closed
amesgen opened this issue Oct 13, 2022 · 1 comment · Fixed by #1137
Closed

Regression: --exec-batch no longer preserves status code #1136

amesgen opened this issue Oct 13, 2022 · 1 comment · Fixed by #1137
Labels

Comments

@amesgen
Copy link
Contributor

amesgen commented Oct 13, 2022

Suppose you have a fd command targeting at least one file, e.g. a directory /dir containing a file foo. Then running

fd foo /dir -X bash -c 'exit 1'

succeeds (based on exit code) in 8.4.0, but fails in e.g. 8.3.2. I would expect the latter to be the correct behavior (since #477).

Bisecting shows that #960 (specifically 9fb0c5d) caused this regression; happy to open a PR if desired.

@sharkdp
Copy link
Owner

sharkdp commented Oct 13, 2022

Thank you for reporting this and tracking this down. Shame on me for not adding a test back then. We should definitely add a regression test when fixing this.

happy to open a PR if desired

that would be great

@sharkdp sharkdp added the bug label Oct 13, 2022
tmccombs added a commit to tmccombs/fd that referenced this issue Oct 15, 2022
If a child process returns a failure status code for --exec-batch, then
have fd also return a failed status code.

Closes: sharkdp#1136
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants