Do no error out on malformed ignore patterns
This commit is contained in:
parent
3e39da071d
commit
3a53b05b29
|
@ -136,12 +136,15 @@ local function compile_ignore_files()
|
||||||
-- config.ignore_files could be a simple string...
|
-- config.ignore_files could be a simple string...
|
||||||
if type(ipatterns) ~= "table" then ipatterns = {ipatterns} end
|
if type(ipatterns) ~= "table" then ipatterns = {ipatterns} end
|
||||||
for i, pattern in ipairs(ipatterns) do
|
for i, pattern in ipairs(ipatterns) do
|
||||||
compiled[i] = {
|
-- we ignore malformed pattern that raise an error
|
||||||
|
if pcall(string.match, "a", pattern) then
|
||||||
|
table.insert(compiled, {
|
||||||
use_path = pattern:match("/[^/$]"), -- contains a slash but not at the end
|
use_path = pattern:match("/[^/$]"), -- contains a slash but not at the end
|
||||||
-- An '/' or '/$' at the end means we want to match a directory.
|
-- An '/' or '/$' at the end means we want to match a directory.
|
||||||
match_dir = pattern:match(".+/%$?$"), -- to be used as a boolen value
|
match_dir = pattern:match(".+/%$?$"), -- to be used as a boolen value
|
||||||
pattern = pattern -- get the actual pattern
|
pattern = pattern -- get the actual pattern
|
||||||
}
|
})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return compiled
|
return compiled
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue