mirror of
https://github.com/kepler155c/opus
synced 2025-10-14 15:27:40 +00:00
custom help files + redo System UI
This commit is contained in:
@@ -18,8 +18,12 @@ end
|
||||
|
||||
local function setModem(dev)
|
||||
if not device.wireless_modem and dev.isWireless() then
|
||||
local config = Config.load('os', { })
|
||||
if not config.wirelessModem or dev.name == config.wirelessModem then
|
||||
local config = Config.load('os')
|
||||
|
||||
if not config.wirelessModem or
|
||||
config.wirelessModem == 'auto' or
|
||||
dev.name == config.wirelessModem then
|
||||
|
||||
device.wireless_modem = dev
|
||||
os.queueEvent('device_attach', 'wireless_modem')
|
||||
return dev
|
||||
|
@@ -3,8 +3,9 @@ _G.requireInjector(_ENV)
|
||||
local Packages = require('packages')
|
||||
local Util = require('util')
|
||||
|
||||
local fs = _G.fs
|
||||
local help = _G.help
|
||||
local shell = _ENV.shell
|
||||
local fs = _G.fs
|
||||
|
||||
local appPaths = Util.split(shell.path(), '(.-);')
|
||||
local luaPaths = Util.split(_G.LUA_PATH, '(.-);')
|
||||
@@ -26,6 +27,9 @@ end
|
||||
-- dependency graph
|
||||
-- https://github.com/mpeterv/depgraph/blob/master/src/depgraph/init.lua
|
||||
|
||||
local helpPaths = Util.split(help.path(), '(.-):')
|
||||
table.insert(helpPaths, '/sys/help')
|
||||
|
||||
for name in pairs(Packages:installed()) do
|
||||
local packageDir = fs.combine('packages', name)
|
||||
if fs.exists(fs.combine(packageDir, '.install')) then
|
||||
@@ -40,7 +44,14 @@ for name in pairs(Packages:installed()) do
|
||||
if fs.exists(apiPath) then
|
||||
addPath(luaPaths, apiPath)
|
||||
end
|
||||
|
||||
local helpPath = fs.combine(fs.combine('packages', name), 'help')
|
||||
if fs.exists(helpPath) then
|
||||
table.insert(helpPaths, helpPath)
|
||||
end
|
||||
end
|
||||
|
||||
help.setPath(table.concat(helpPaths, ':'))
|
||||
|
||||
shell.setPath(table.concat(appPaths, ':'))
|
||||
_G.LUA_PATH = table.concat(luaPaths, ';')
|
||||
|
Reference in New Issue
Block a user