-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip SC2015 when it end with: || true #2977
Comments
Workaround: Currently this can be bypassed by using command groupings. #!/bin/sh
set -e
# $? will be 0
{ foo && bar; } || : |
Here's a write up on the pitfall underlying SC2015.
https://mywiki.wooledge.org/BashPitfalls#cmd1_.26.26_cmd2_.7C.7C_cmd3
…On Thu, Oct 3, 2024, 21:58 Jakub Kapusta ***@***.***> wrote:
Workaround: Currently this can be bypassed by using command groupings.
#!/bin/shset -e
{ foo && bar; } || :
—
Reply to this email directly, view it on GitHub
<#2977 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUF2F2ZRAW25VQ25EOZYPVLZZYOBDAVCNFSM6AAAAABHHGQD2KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOJSHAZDGNZRG4>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Thanks for the link, very insightful. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For bugs
shellcheck --version
or "online"): onlineHere's a snippet or screenshot that shows the problem:
Here's what shellcheck currently says:
Here's what I wanted or expected to see:
Nothing, the
|| true
is used to ignore return codes so even if it get executed when A is true it doesn't matter.The text was updated successfully, but these errors were encountered: