From 9c599e4171613de296d4df182478518fcccdb03e Mon Sep 17 00:00:00 2001 From: Vurv <56230599+Vurv78@users.noreply.github.com> Date: Thu, 6 Jul 2023 15:12:36 -0700 Subject: [PATCH] fix: incorrect path code & warning 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. --- README.md | 2 +- gma.lua | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1b2cfa1..5d5fb71 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@master - - uses: vurv78/gmod-upload@v0.1.1 + - uses: vurv78/gmod-upload@v0.1.2 with: id: 2466875474 changelog: "Deployment via Github to latest changes" diff --git a/gma.lua b/gma.lua index 2d75a0e..f4f931c 100644 --- a/gma.lua +++ b/gma.lua @@ -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()