Skip to content

Commit

Permalink
ignore comments in ignore files
Browse files Browse the repository at this point in the history
  • Loading branch information
garrett361 committed Mar 25, 2024
1 parent 1b8930f commit 8697368
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lua/rsync/sync.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,12 @@ local function create_filters(filter_paths)

if f ~= nil then
for line in f:lines() do
if line:sub(1, 1) == "!" then
include = include .. "--include='" .. line:sub(2, -1) .. "' "
else
exclude = exclude .. "--exclude='" .. line .. "' "
if line:sub(1, 1) ~= "#" then
if line:sub(1, 1) == "!" then
include = include .. "--include='" .. line:sub(2, -1) .. "' "
else
exclude = exclude .. "--exclude='" .. line .. "' "
end
end
end
end
Expand Down

0 comments on commit 8697368

Please sign in to comment.