Added support to use a array of regex to ignore files

This commit is contained in:
Dheisom Gomes
2022-01-28 12:02:30 -03:00
parent 8c0685d440
commit 6331a23c6b
3 changed files with 16 additions and 3 deletions
+13
View File
@@ -1,3 +1,5 @@
local config = require 'core.config'
local common = {}
@@ -445,4 +447,15 @@ function common.rm(path, recursively)
return true
end
---@param filename string
---@return boolean
function common.match_ignore_files(filename)
for _, pattern in ipairs(config.ignore_files) do
if common.match_pattern(filename, pattern) then
return true
end
end
return false
end
return common