I'm running a program where an exit code of either 0 or 1 indicates success. I'm running this while building a docker image, so if the return code is not 0, the build fails. How can I capture the exit code and force an exit code of 0 if the actual exit code is 0 or 1 so that the docker image can properly build?
I've tried something like this where (exit 1) represents the program:
((exit 1) && if [ $? == 0 || $? == 1]; then exit 0; else exit 1; fi;)
but it's not working, an exit code of 1 still exits with 1.
I would rather not do program || true
in case the program actually does fail for some reason
Thanks!