I am using "find" in a Travis-CI to check a particular file type with a program. (To be exact, it is a shellcheck check.)
However, when using find the exit codes of the command(s)/subshells executed by it are naturally discarded, as they are not passed to the "main script".
As an example this is a find command:
find . -type f -iname "*.sh" -exec sh ./testScripts.sh "{}" \;
./testScripts.sh may exit with 0 or >= 1, depending on the test result.
The testScripts.sh exits properly with the correct exit code, but due to find the exit code of the command is always "0". All I want is, that if one file/execution errors, this error is "propagated" up to Travis-CI.
How can I accomplish this?
testScripts.shso it accepts multiple scripts to run? That way you could use the-exec {} +variant, which exits with status != 0 if the command fails.testScripts.sh, but that is acceptable.