2018-01-24 22:39:38 +00:00
|
|
|
_G.requireInjector(_ENV)
|
2018-01-14 21:44:43 +00:00
|
|
|
|
|
|
|
local Util = require('util')
|
|
|
|
|
|
|
|
local fs = _G.fs
|
|
|
|
local shell = _ENV.shell
|
|
|
|
|
|
|
|
if not fs.exists('usr/apps') then
|
2018-01-24 22:39:38 +00:00
|
|
|
fs.makeDir('usr/apps')
|
2018-01-14 21:44:43 +00:00
|
|
|
end
|
|
|
|
if not fs.exists('usr/autorun') then
|
2018-01-24 22:39:38 +00:00
|
|
|
fs.makeDir('usr/autorun')
|
2018-01-14 21:44:43 +00:00
|
|
|
end
|
2018-11-03 22:13:41 +00:00
|
|
|
--if not fs.exists('usr/config/fstab') then
|
|
|
|
-- Util.writeFile('usr/config/fstab',
|
|
|
|
-- 'usr gitfs kepler155c/opus-apps/' .. _G.OPUS_BRANCH)
|
|
|
|
--end
|
2018-01-14 21:44:43 +00:00
|
|
|
|
|
|
|
if not fs.exists('usr/config/shell') then
|
2018-01-24 22:39:38 +00:00
|
|
|
Util.writeTable('usr/config/shell', {
|
|
|
|
aliases = shell.aliases(),
|
|
|
|
path = 'usr/apps:sys/apps:' .. shell.path(),
|
|
|
|
lua_path = 'sys/apis:usr/apis',
|
|
|
|
})
|
2018-01-14 21:44:43 +00:00
|
|
|
end
|
|
|
|
|
2018-11-21 17:10:20 +00:00
|
|
|
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
|
|
|
|
|
2018-01-14 21:44:43 +00:00
|
|
|
local config = Util.readTable('usr/config/shell')
|
|
|
|
if config.aliases then
|
2018-01-24 22:39:38 +00:00
|
|
|
for k in pairs(shell.aliases()) do
|
|
|
|
shell.clearAlias(k)
|
|
|
|
end
|
|
|
|
for k,v in pairs(config.aliases) do
|
|
|
|
shell.setAlias(k, v)
|
|
|
|
end
|
2018-01-14 21:44:43 +00:00
|
|
|
end
|
|
|
|
shell.setPath(config.path)
|
2018-01-26 11:37:49 +00:00
|
|
|
_G.LUA_PATH = config.lua_path
|
2018-01-14 21:44:43 +00:00
|
|
|
|
2018-01-20 12:18:13 +00:00
|
|
|
fs.loadTab('usr/config/fstab')
|