-
-
Save rubenwardy/e2f1f09fa0e0c8545850 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local done = 0 | |
local failed = 0 | |
local notfound = 0 | |
local uptodate = 0 | |
local function run_query_wrapper(query) | |
if query:sub(#query) == "?" then | |
query = query:sub(1, #query - 1) | |
if not options.yes then | |
print("Skipping optional mod " .. query) | |
return | |
end | |
end | |
local status, msg = mtpm.run_query(query) | |
if msg then | |
print(msg) | |
end | |
if status == 0 then | |
failed = failed + 1 | |
elseif status == 1 then | |
done = done + 1 | |
elseif status == 2 then | |
uptodate = uptodate + 1 | |
elseif status == 3 then | |
notfound = notfound + 1 | |
end | |
end | |
-- Read from arguments | |
for i = 2, #args do | |
run_query_wrapper(args[i]) | |
end | |
-- Look for depends.txt files to read | |
if options.depends then | |
f = io.open(options.depends, "r") | |
for line in f:lines() do | |
run_query_wrapper(line:trim()) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment