Skip to content

Commit 4a074f4

Browse files
committed
fix checkRequirements
1 parent 94f1581 commit 4a074f4

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

scm.lua

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -607,29 +607,32 @@ function scm:checkRequirements(name)
607607
scriptName = string.sub(line, 0)
608608
end
609609

610-
local scriptExists = false
611-
for i = 1, #self.scripts, 1 do
612-
if self.scripts[i].name == scriptName then
613-
scriptExists = true
614-
end
615-
end
616-
if scriptExists then
617-
-- requirement already satisfied!
618-
scm:log("Requirement already satisfied! (" .. scriptName .. ")")
619-
else
620-
requires[#requires + 1] = scriptName
621-
end
610+
requires[#requires + 1] = scriptName
622611
end
623612
end
624613
file.close()
625614

626615
-- Install missing requirements
627616
for i = 1, #requires do
628617
local n = requires[i]
629-
scm:log("Trying to install " .. n .. "...")
630-
self:download(n, "library")
631618
local tmpName, tmpCode = self:splitNameCode(n)
632619
if tmpCode then n = tmpName end
620+
621+
scm:log("Trying to install " .. n .. "...")
622+
623+
local scriptExists = false
624+
for j = 1, #self.scripts, 1 do
625+
if self.scripts[j].name == n then
626+
scriptExists = true
627+
end
628+
end
629+
630+
if not scriptExists then
631+
self:download(tmpName .. "@" .. tmpCode, "library")
632+
else
633+
scm:log(n .. " already exists.")
634+
end
635+
633636
self:checkRequirements(n)
634637
end
635638
end

0 commit comments

Comments
 (0)