andsens / homeshick

git dotfiles synchronizer written in bash
MIT License
2.11k stars 145 forks source link

Set the exit code correctly in `test/run` when tests fail #218

Closed yut23 closed 1 year ago

yut23 commented 1 year ago

The previous code was actually getting the exit code of !, which is always 0 inside the if statement.

andsens commented 1 year ago

Good catch. That's some old code from before I had learned all the insidious pitfalls of bash. I should probably go through the entire codebase with fresh eyes :-)
Also, this would make for an excellent shellcheck rule.

andsens commented 1 year ago

There we go :-) https://github.com/koalaman/shellcheck/issues/2847