mirror of
https://github.com/octoleo/lsyncd.git
synced 2025-01-08 09:18:30 +00:00
prepending arguments with -- so they can start with a -
This commit is contained in:
parent
6b6d718a48
commit
aaae8f4083
@ -62,6 +62,7 @@ direct.action = function(inlet)
|
|||||||
spawn(
|
spawn(
|
||||||
event,
|
event,
|
||||||
'/bin/mkdir',
|
'/bin/mkdir',
|
||||||
|
'--',
|
||||||
event.targetPath
|
event.targetPath
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
@ -69,6 +70,7 @@ direct.action = function(inlet)
|
|||||||
spawn(
|
spawn(
|
||||||
event,
|
event,
|
||||||
'/bin/cp',
|
'/bin/cp',
|
||||||
|
'--',
|
||||||
event.sourcePath,
|
event.sourcePath,
|
||||||
event.targetPathdir
|
event.targetPathdir
|
||||||
)
|
)
|
||||||
@ -79,6 +81,7 @@ direct.action = function(inlet)
|
|||||||
end
|
end
|
||||||
spawn(event,
|
spawn(event,
|
||||||
'/bin/cp',
|
'/bin/cp',
|
||||||
|
'--',
|
||||||
event.sourcePath,
|
event.sourcePath,
|
||||||
event.targetPathdir
|
event.targetPathdir
|
||||||
)
|
)
|
||||||
@ -99,7 +102,7 @@ direct.action = function(inlet)
|
|||||||
error('Refusing to erase your harddisk!')
|
error('Refusing to erase your harddisk!')
|
||||||
end
|
end
|
||||||
|
|
||||||
spawn(event, '/bin/rm', '-rf', tp)
|
spawn(event, '/bin/rm', '-rf', '--', tp)
|
||||||
|
|
||||||
elseif event.etype == 'Move' then
|
elseif event.etype == 'Move' then
|
||||||
local tp = event.targetPath
|
local tp = event.targetPath
|
||||||
@ -109,13 +112,13 @@ direct.action = function(inlet)
|
|||||||
error('Refusing to erase your harddisk!')
|
error('Refusing to erase your harddisk!')
|
||||||
end
|
end
|
||||||
|
|
||||||
local command = '/bin/mv "$1" "$2" || /bin/rm -rf "$1"'
|
local command = '/bin/mv -- "$1" "$2" || /bin/rm -rf -- "$1"'
|
||||||
|
|
||||||
if
|
if
|
||||||
config.delete ~= true and
|
config.delete ~= true and
|
||||||
config.delete ~= 'running'
|
config.delete ~= 'running'
|
||||||
then
|
then
|
||||||
command = '/bin/mv "$1" "$2"'
|
command = '/bin/mv -- "$1" "$2"'
|
||||||
end
|
end
|
||||||
|
|
||||||
spawnShell(
|
spawnShell(
|
||||||
|
Loading…
Reference in New Issue
Block a user