From b197457586349cdb4a6c459a4076505beeecfae9 Mon Sep 17 00:00:00 2001 From: David Leal Date: Thu, 29 Jun 2023 03:15:21 +0000 Subject: [PATCH] Properly check if a repository exists or not --- update-repos.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/update-repos.lua b/update-repos.lua index 405f3ef2..5abf42c9 100644 --- a/update-repos.lua +++ b/update-repos.lua @@ -31,16 +31,13 @@ local function update_repos() check_variables(repos, i) -- Make sure the repository is cloned already. - if os.execute("test -d " .. repos[i].dir .. repos[i].name) ~= 0 then + if os.execute("test -d " .. repos[i].dir .. repos[i].name) == nil then print("Warning: " .. repos[i].dir .. repos[i].name .. " does not exist. Skipping.") goto continue end -- Update the repository with the given options. - os.execute("cd " .. repos[i].dir .. repos[i].name .. " && git pull") - os.execute("git add .") - os.execute("cd ..") -- Go back. - + os.execute("cd " .. repos[i].dir .. repos[i].name .. " && git pull && git add .") ::continue:: end