mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-08 05:51:09 -07:00
Use head instead of (!! 0)
This commit is contained in:
parent
2ebf522a52
commit
4604066c37
1 changed files with 1 additions and 1 deletions
|
@ -798,7 +798,7 @@ getVariablesFromLiteralToken token =
|
|||
prop_getVariablesFromLiteral1 =
|
||||
getVariablesFromLiteral "$foo${bar//a/b}$BAZ" == ["foo", "bar", "BAZ"]
|
||||
getVariablesFromLiteral string =
|
||||
map (!! 0) $ matchAllSubgroups variableRegex string
|
||||
map head $ matchAllSubgroups variableRegex string
|
||||
where
|
||||
variableRegex = mkRegex "\\$\\{?([A-Za-z0-9_]+)"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue