mirror of https://github.com/octoleo/lsyncd.git
realtive paths do not start with a slash
This commit is contained in:
parent
ff891441c8
commit
12d4f43d0f
27
lsyncd.lua
27
lsyncd.lua
|
@ -1283,7 +1283,14 @@ local InletFactory = ( function
|
||||||
(
|
(
|
||||||
event
|
event
|
||||||
)
|
)
|
||||||
return getPath( event )
|
local p = getPath( event )
|
||||||
|
|
||||||
|
if string.byte( path, 1 ) == 47
|
||||||
|
then
|
||||||
|
p = string.sub( p, 2, -1 )
|
||||||
|
end
|
||||||
|
|
||||||
|
return p
|
||||||
end,
|
end,
|
||||||
|
|
||||||
--
|
--
|
||||||
|
@ -1294,7 +1301,14 @@ local InletFactory = ( function
|
||||||
(
|
(
|
||||||
event
|
event
|
||||||
)
|
)
|
||||||
return string.match( getPath( event ), '^(.*/)[^/]+/?' ) or ''
|
local p = getPath( event )
|
||||||
|
|
||||||
|
if string.byte( path, 1 ) == 47
|
||||||
|
then
|
||||||
|
p = string.sub( p, 2, -1 )
|
||||||
|
end
|
||||||
|
|
||||||
|
return string.match( p, '^(.*/)[^/]+/?' ) or ''
|
||||||
end,
|
end,
|
||||||
|
|
||||||
--
|
--
|
||||||
|
@ -1305,7 +1319,14 @@ local InletFactory = ( function
|
||||||
(
|
(
|
||||||
event
|
event
|
||||||
)
|
)
|
||||||
return cutSlash( getPath( event ) )
|
local p = getPath( event )
|
||||||
|
|
||||||
|
if string.byte( path, 1 ) == 47
|
||||||
|
then
|
||||||
|
p = string.sub( p, 2, -1 )
|
||||||
|
end
|
||||||
|
|
||||||
|
return cutSlash( p )
|
||||||
end,
|
end,
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
Loading…
Reference in New Issue