irongit

Configure synchronization of files and directories through a plugin.

added exclude from

huncholanehuncholaneauthored
parent 48f5f21commit 6372a43dd57d58d778b5056182234de17802b95fBrowse files

1 file changed, +7 -3

+7-3lua/syncmap/utils.lua
@@ -53,6 +53,7 @@ end
5353 function M.extract_exclude_from(m)
5454 if m.exclude_from == nil then
5555 if M.opts.exclude_from ~= nil then
56+ m.exclude_from = M.opts.exclude_from
5657 return M.string_to_exclude_from(M.opts.exclude_from)
5758 end
5859 return nil
@@ -69,12 +70,15 @@ function M.extract_flags(m)
6970 if flags == nil then
7071 flags = M.opts.rsync
7172 end
73+ local exclude_from = M.extract_exclude_from(m)
7274 if m.exclude_from == nil then
7375 return flags
7476 end
75- if is_dir(m[1]) then
76- if file_exists(with_trailing_slash(m[1]) .. m.exclude_from) then
77- table.insert(flags, M.extract_exclude_from(m))
77+ local src = vim.fn.expand(m[1])
78+ local stat = vim.uv.fs_stat(src)
79+ if stat and stat.type == "directory" then
80+ if file_exists(with_trailing_slash(src) .. m.exclude_from) then
81+ table.insert(flags, exclude_from)
7882 end
7983 end
8084 return flags