Skip to content

Commit 075cafa

Browse files
att
1 parent c6d1bfa commit 075cafa

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

luasrc/patch.lua

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,37 @@
11

2+
private_vibescript.match_pattern = function (item,pattern)
3+
4+
local start_char = string.sub(pattern,1,1)
5+
if start_char == "*" then
6+
pattern = string.sub(pattern,2)
7+
return dtw.ends_with(item,pattern)
8+
end
9+
10+
local end_char = string.sub(pattern,-1,-1)
11+
if end_char == "*" then
12+
pattern = string.sub(pattern,1,-2)
13+
return dtw.starts_with(item,pattern)
14+
end
15+
return item == pattern
16+
end
17+
218
private_vibescript.remove_itens_of_list = function (itens,itens_to_exclude)
319
local filtered_itens = {}
420
for i=1,#itens do
521
local item = itens[i]
622
local exclude_item = false
7-
8-
23+
for j=1,#itens_to_exclude do
24+
local possible_exclusion = itens_to_exclude[j]
25+
26+
end
927
end
28+
return filtered_itens
1029
end
1130

1231
private_vibescript.configure_patch = function ()
1332
function ApplyPatch(patch)
14-
15-
33+
print(private_vibescript.match_pattern(".git/config",".git/*"))
34+
if true then return end
1635

1736
if not patch then
1837
error("No patch provided")

0 commit comments

Comments
 (0)