Add validate handler to install selected packages from Welcome wizard
This commit is contained in:
@@ -129,6 +129,19 @@ local page = UI.Page {
|
|||||||
text = 'More Packages...',
|
text = 'More Packages...',
|
||||||
event = 'packages',
|
event = 'packages',
|
||||||
},
|
},
|
||||||
|
validate = function(self)
|
||||||
|
local toInstall = { }
|
||||||
|
if self.chkTurtle.value then
|
||||||
|
table.insert(toInstall, 'remoteturtle')
|
||||||
|
end
|
||||||
|
if self.chkInventory.value then
|
||||||
|
table.insert(toInstall, 'inventory-manager')
|
||||||
|
end
|
||||||
|
for _, pkg in ipairs(toInstall) do
|
||||||
|
shell.run('package install ' .. pkg)
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
contributors = UI.WizardPage {
|
contributors = UI.WizardPage {
|
||||||
index = 5,
|
index = 5,
|
||||||
|
|||||||
Reference in New Issue
Block a user