1
0
mirror of https://github.com/kepler155c/opus synced 2024-06-18 11:20:01 +00:00

package manager wip

This commit is contained in:
kepler155c@gmail.com 2018-10-21 04:46:40 -04:00
parent b7176e55ad
commit 97c4b7a090
2 changed files with 9 additions and 3 deletions

View File

@ -15,7 +15,10 @@ function Config.load(fname, data)
if not fs.exists(filename) then
Util.writeTable(filename, data)
else
Util.merge(data, Util.readTable(filename) or { })
local contents = Util.readTable(filename) or
error('Configuration file is corrupt:' .. filename)
Util.merge(data, contents)
end
end

View File

@ -30,8 +30,11 @@ for name, package in pairs(Packages:installed()) do
fs.mount(table.unpack(Util.matches(package.mount)))
end
addPath(appPaths, fs.combine(fs.combine('packages', name), 'apps'))
addPath(luaPaths, fs.combine(fs.combine('packages', name), 'apis'))
addPath(appPaths, fs.combine('packages', name))
local apiPath = fs.combine(fs.combine('packages', name), 'apis')
if fs.exists(apiPath) then
addPath(luaPaths, apiPath)
end
end
shell.setPath(table.concat(appPaths, ':'))