package manager improvements

This commit is contained in:
kepler155c@gmail.com
2019-07-03 10:44:30 -04:00
parent 9456d31881
commit 0b222207ba
6 changed files with 53 additions and 18 deletions

View File

@@ -35,13 +35,15 @@ local function progress(max)
end
end
local function install(name, isUpdate)
local function install(name, isUpdate, ignoreDeps)
local manifest = Packages:downloadManifest(name) or error('Invalid package')
if manifest.required then
for _, v in pairs(manifest.required) do
if isUpdate or not Packages:isInstalled(v) then
install(v, isUpdate)
if not ignoreDeps then
if manifest.required then
for _, v in pairs(manifest.required) do
if isUpdate or not Packages:isInstalled(v) then
install(v, isUpdate)
end
end
end
end
@@ -89,6 +91,21 @@ if action == 'install' then
return
end
if action == 'refresh' then
print('Downloading...')
Packages:downloadList()
print('refresh complete')
return
end
if action == 'updateall' then
for name in pairs(Packages:installed()) do
install(name, true, true)
end
print('updateall complete')
return
end
if action == 'update' then
local name = args[1] or Syntax('Invalid package')
if not Packages:isInstalled(name) then