mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Updated SC2251 (markdown)
@@ -27,8 +27,8 @@ Adding `|| exit ` will instead exit with failure when the command succeeds.
|
||||
|
||||
ShellCheck will not detect cases where `$?` is implicitly or explicitly used to check the value afterwards:
|
||||
|
||||
```
|
||||
set -e;
|
||||
```sh
|
||||
set -e
|
||||
check_success() { [ $? -eq 0 ] || exit 1; }
|
||||
! false; check_success
|
||||
! true; check_success
|
||||
|
Reference in New Issue
Block a user