Configure synchronization of files and directories through a plugin.
fixed the reverse sync
1 file changed, +8 -4
+8-4lua/syncmap/rsync.lua
| @@ -20,7 +20,12 @@ end | ||
| 20 | 20 | ---@param args RsyncParams |
| 21 | 21 | function M.spawn_watcher(args) |
| 22 | 22 | 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 | + }) | |
| 24 | 29 | end |
| 25 | 30 | |
| 26 | 31 | simple_cmd.spawn("sh", { |
| @@ -36,13 +41,12 @@ function M.spawn_watcher(args) | ||
| 36 | 41 | }, |
| 37 | 42 | path = "sh", |
| 38 | 43 | cwd = args.src, |
| 39 | - callback = function(code, status, handle, pid) | |
| 44 | + callback = function(code, status, _, pid) | |
| 40 | 45 | log.info( |
| 41 | 46 | 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.", | |
| 43 | 48 | code, |
| 44 | 49 | status, |
| 45 | - handle:get_pid(), | |
| 46 | 50 | pid |
| 47 | 51 | ) |
| 48 | 52 | ) |