Skip to content

Commit

Permalink
Properly check if a repository exists or not
Browse files Browse the repository at this point in the history
  • Loading branch information
Panquesito7 committed Jun 29, 2023
1 parent 4682323 commit b197457
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions update-repos.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b197457

Please sign in to comment.