mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 12:30:52 +08:00
Use head instead of (!! 0)
This commit is contained in:
@@ -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_]+)"
|
||||
|
||||
|
Reference in New Issue
Block a user