mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-07 02:31:17 +08:00
Added more helpful message for 'if [ grep .. ]'
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user