mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-16 10:03:08 -07:00
Warn when $? refers to echo or condition (ref #2541)
This commit is contained in:
parent
b261ec24f9
commit
5cf6e01ce9
4 changed files with 42 additions and 0 deletions
|
@ -804,6 +804,7 @@ fulfillsDependency ctx entry dep =
|
|||
-- it won't be found by the normal check.
|
||||
DepIsRecursive node val | node == entry -> return True
|
||||
DepIsRecursive node val -> return $ val == any (\f -> entryPoint f == node) (cStack ctx)
|
||||
DepExitCodes val -> (== val) <$> peekStack (\s k -> sExitCodes s) S.empty ctx ()
|
||||
-- _ -> error $ "Unknown dep " ++ show dep
|
||||
where
|
||||
peek scope = peekStack getVariableWithScope $ if scope == GlobalScope then (unknownVariableState, GlobalScope) else (unsetVariableState, LocalScope)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue