irongit

Configure synchronization of files and directories through a plugin.

fixed the reverse sync

huncholanehuncholaneauthored
parent f3551ebcommit ce78121c6dd2165a5f6c1238d4e0af5c5e2bd28aBrowse files

1 file changed, +8 -4

+8-4lua/syncmap/rsync.lua
@@ -20,7 +20,12 @@ end
2020 ---@param args RsyncParams
2121 function M.spawn_watcher(args)
2222 if M.opts.reverse_sync_on_startup then
23- M.run(args)
23+ M.run({
24+ src = args.dst,
25+ dst = args.src,
26+ reverse_sync_on_spawn = args.reverse_sync_on_spawn,
27+ flags = args.flags,
28+ })
2429 end
2530
2631 simple_cmd.spawn("sh", {
@@ -36,13 +41,12 @@ function M.spawn_watcher(args)
3641 },
3742 path = "sh",
3843 cwd = args.src,
39- callback = function(code, status, handle, pid)
44+ callback = function(code, status, _, pid)
4045 log.info(
4146 string.format(
42- "The process ended with %q code and status %q.\nThe pid from handle is %q.\nThe original pid is %q.",
47+ "The inotify trigger ended with %d code and status %d.\nThe pid from handle is %d.",
4348 code,
4449 status,
45- handle:get_pid(),
4650 pid
4751 )
4852 )