mirror of https://github.com/octoleo/lsyncd.git
fixed exclude param
This commit is contained in:
parent
07e35ffe60
commit
f6182cb9f6
13
lsyncd.lua
13
lsyncd.lua
|
@ -919,7 +919,7 @@ local Excludes = (function()
|
||||||
-- Adds a list of patterns to exclude.
|
-- Adds a list of patterns to exclude.
|
||||||
--
|
--
|
||||||
local function addList(self, plist)
|
local function addList(self, plist)
|
||||||
for _, v in plist do
|
for _, v in ipairs(plist) do
|
||||||
add(self, v)
|
add(self, v)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -966,7 +966,7 @@ local Excludes = (function()
|
||||||
|
|
||||||
-- functions
|
-- functions
|
||||||
add = add,
|
add = add,
|
||||||
adList = addList,
|
addList = addList,
|
||||||
loadFile = loadFile,
|
loadFile = loadFile,
|
||||||
remove = remove,
|
remove = remove,
|
||||||
test = test,
|
test = test,
|
||||||
|
@ -1413,7 +1413,14 @@ local Sync = (function()
|
||||||
|
|
||||||
-- loads exclusions
|
-- loads exclusions
|
||||||
if config.exclude then
|
if config.exclude then
|
||||||
s.excludes:addList(config.exclude)
|
local te = type(config.exclude)
|
||||||
|
if te == "table" then
|
||||||
|
s.excludes:addList(config.exclude)
|
||||||
|
elseif te == "string" then
|
||||||
|
s.excludes:add(config.exclude)
|
||||||
|
else
|
||||||
|
error("type for exclude must be table or string", 2)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if config.excludeFrom then
|
if config.excludeFrom then
|
||||||
s.excludes:loadFile(config.excludeFrom)
|
s.excludes:loadFile(config.excludeFrom)
|
||||||
|
|
Loading…
Reference in New Issue