Skip to content

Commit

Permalink
fix: incorrect path code & warning
Browse files Browse the repository at this point in the history
This is what happens without unit tests. Want to get them done but I was waiting on getting a node version first.

:sub(2) strips the first character from a string. needed to strip the first two, so :sub(3).

also the break in the inner loop to avoid duplicates was causing warnings on whitelisted files, so changed that to skip as well.
  • Loading branch information
Vurv78 committed Jul 6, 2023
1 parent 658a01a commit 9c599e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- uses: actions/checkout@master
- uses: vurv78/[email protected].1
- uses: vurv78/[email protected].2
with:
id: 2466875474
changelog: "Deployment via Github to latest changes"
Expand Down
8 changes: 4 additions & 4 deletions gma.lua
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,21 @@ do
for _, block_pattern in ipairs(blocklist) do
if normalized:match(block_pattern) then
print("Blocked ", normalized)
goto skip
goto cont
end
end

files[#files + 1] = {
path = normalized:sub(2), -- strip initial ./ part
path = normalized:sub(3), -- strip initial ./ part
content = read(path)
}

break
goto cont
end
end

print("Warning: File " .. normalized .. " not whitelisted. Skipping..")
::skip::
::cont::
end

dir:close()
Expand Down

0 comments on commit 9c599e4

Please sign in to comment.