mirror of
https://github.com/octoleo/lsyncd.git
synced 2024-12-04 19:03:17 +00:00
fix exclusion tests
This commit is contained in:
parent
288f09ad01
commit
3f78514273
@ -1,5 +1,6 @@
|
||||
????-??-??: 2.2.2
|
||||
fix: checkgauge 'insist'
|
||||
fix: no partial path exlusion tests
|
||||
|
||||
2017-01-05: 2.2.1
|
||||
enhancement: now always using filter lists with rysnc
|
||||
|
19
lsyncd.lua
19
lsyncd.lua
@ -1852,13 +1852,13 @@ local Excludes = ( function( )
|
||||
p = string.gsub( p, '%[%^/%]%*%[%^/%]%*', '.*' )
|
||||
p = string.gsub( p, '^/', '^/' )
|
||||
|
||||
-- if p:sub( 1, 2 ) ~= '^/'
|
||||
-- then
|
||||
-- -- if does not begin with '^/'
|
||||
-- -- then all matches should begin with '/'.
|
||||
-- p = '/' .. p;
|
||||
-- end
|
||||
--
|
||||
if p:sub( 1, 2 ) ~= '^/'
|
||||
then
|
||||
-- if does not begin with '^/'
|
||||
-- then all matches should begin with '/'.
|
||||
p = '/' .. p;
|
||||
end
|
||||
|
||||
log(
|
||||
'Exclude',
|
||||
'toLuaPattern "',
|
||||
@ -1971,6 +1971,11 @@ local Excludes = ( function( )
|
||||
self, -- self
|
||||
path -- the path to test
|
||||
)
|
||||
if path:byte( 1 ) ~= 47
|
||||
then
|
||||
error( 'Paths for exlusion tests must start with \'/\'' )
|
||||
end
|
||||
|
||||
for _, p in pairs( self.list )
|
||||
do
|
||||
if p:byte( -1 ) == 36
|
||||
|
Loading…
Reference in New Issue
Block a user