1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-14 07:17:40 +00:00

package manager

This commit is contained in:
kepler155c@gmail.com
2019-01-09 06:59:19 -05:00
parent 4387264960
commit 4977ea94d7
4 changed files with 59 additions and 40 deletions

View File

@@ -1,5 +1,3 @@
_G.requireInjector(_ENV)
local Util = require('util')
local fs = _G.fs
@@ -29,17 +27,6 @@ if not fs.exists('usr/config/shell') then
})
end
if not fs.exists('usr/config/packages') then
local packages = {
[ 'develop-1.8' ] = 'https://pastebin.com/raw/WhEiNGZE',
[ 'master-1.8' ] = 'https://pastebin.com/raw/pexZpAxt',
}
if packages[_G.OPUS_BRANCH] then
Util.download(packages[_G.OPUS_BRANCH], 'usr/config/packages')
end
end
local config = Util.readTable('usr/config/shell')
if config.aliases then
for k in pairs(shell.aliases()) do

View File

@@ -1,5 +1,3 @@
_G.requireInjector(_ENV)
local Packages = require('packages')
local Util = require('util')
@@ -7,6 +5,10 @@ local fs = _G.fs
local help = _G.help
local shell = _ENV.shell
if not fs.exists('usr/config/packages') then
Packages:downloadList()
end
local appPaths = Util.split(shell.path(), '(.-):')
local luaPaths = Util.split(_G.LUA_PATH, '(.-);')
local helpPaths = Util.split(help.path(), '(.-):')
@@ -50,6 +52,5 @@ for name in pairs(Packages:installed()) do
end
help.setPath(table.concat(helpPaths, ':'))
shell.setPath(table.concat(appPaths, ':'))
_G.LUA_PATH = table.concat(luaPaths, ';')