@@ -22,21 +22,22 @@ private_vibescript.remove_itens_of_list = function (itens,itens_to_exclude)
2222 local exclude_item = false
2323 for j = 1 ,# itens_to_exclude do
2424 local possible_exclusion = itens_to_exclude [j ]
25-
25+ if (private_vibescript .match_pattern (item ,possible_exclusion )) then
26+ print (" Excluding item: " .. item .. " by pattern: " .. possible_exclusion )
27+ exclude_item = true
28+ break
29+ end
2630 end
31+ if not exclude_item then
32+ table.insert (filtered_itens ,item )
33+ end
2734 end
2835 return filtered_itens
2936end
3037
3138private_vibescript .configure_patch = function ()
3239 function ApplyPatch (patch )
33- print (private_vibescript .match_pattern (" .git/config" ," .git/*" ))
34- print (private_vibescript .match_pattern (" teste" ," teste" ))
35- print (private_vibescript .match_pattern (" teste" ," .git/*" ))
36- print (private_vibescript .match_pattern (" .git/config" ," .git/" ))
37- print (private_vibescript .match_pattern (" config/teste" ," *config/teste" ))
38-
39- if true then return end
40+
4041
4142 if not patch then
4243 error (" No patch provided" )
@@ -70,6 +71,14 @@ private_vibescript.configure_patch = function ()
7071 local internal_excudes = {
7172 " .git/*"
7273 }
74+ local filtered_itens = private_vibescript .remove_itens_of_list (itens_to_copy ,internal_excudes )
75+ if patch .excludes then
76+ filtered_itens = private_vibescript .remove_itens_of_list (filtered_itens ,patch .excludes )
77+ end
78+ for i = 1 ,# filtered_itens do
79+ local item = filtered_itens [i ]
80+ print (" Applying patch item: " .. item )
81+ end
7382
7483
7584 end
0 commit comments