mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-16 10:03:08 -07:00
Added more helpful message for 'if [ grep .. ]'
This commit is contained in:
parent
7025ebd633
commit
34690ad3db
1 changed files with 1 additions and 1 deletions
|
@ -166,7 +166,7 @@ readConditionContents single = do
|
|||
readCondContents `attempting` (lookAhead $ do
|
||||
pos <- getPosition
|
||||
choice (map (try . string) commonCommands)
|
||||
parseProblemAt pos WarningC "To check a command, skip [] and just do 'if foo | grep bar; then'.")
|
||||
parseProblemAt pos WarningC "Use 'if cmd; then ..' to check exit code, or 'if [[ $(cmd) == .. ]]' to check output.")
|
||||
|
||||
where
|
||||
typ = if single then SingleBracket else DoubleBracket
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue