Execute `exit 1` when shell script `cd` fails
It's dangerous when `cd` fails but following commands keeps running which would lead to expected results. For those shell scripts without `set -e`, use `exit 1` before furthur refactor could be a safe and efficient workaround, for thoes shell scripts with `-e`, the shell(script) will exit immediately if any command has a non-zero exit status, so they don't need `exit 1` Reference: - https://github.com/koalaman/shellcheck/wiki/SC2164
Showing
Please register or sign in to comment