1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-19 17:57:39 +00:00
This commit is contained in:
kepler155c@gmail.com
2017-10-16 16:54:50 -04:00
parent fe0ca72b8b
commit 39ba226a82
3 changed files with 85 additions and 131 deletions

View File

@@ -84,7 +84,7 @@ function input:translate(event, code, p1, p2)
self.ch = 'paste'
self.pressed[keys.leftCtrl] = nil
self.pressed[keys.rightCtrl] = nil
self.fired = input:toCode(0)
self.fired = input:toCode(0, self.ch)
return self.fired
elseif event == 'mouse_click' then

View File

@@ -1,55 +0,0 @@
local colors = _G.colors
local fs = _G.fs
local os = _G.os
local shell = _ENV.shell
local term = _G.term
local Opus = { }
local function runDir(directory, open)
if not fs.exists(directory) then
return true
end
local success = true
local files = fs.list(directory)
table.sort(files)
for _,file in ipairs(files) do
os.sleep(0)
local result, err = open(directory .. '/' .. file)
if result then
if term.isColor() then
term.setTextColor(colors.green)
end
term.write('[PASS] ')
term.setTextColor(colors.white)
term.write(fs.combine(directory, file))
else
if term.isColor() then
term.setTextColor(colors.red)
end
term.write('[FAIL] ')
term.setTextColor(colors.white)
term.write(fs.combine(directory, file))
if err then
_G.printError(err)
end
success = false
end
print()
end
return success
end
function Opus.loadServices()
return runDir('sys/services', shell.openHiddenTab)
end
function Opus.autorun()
local s = runDir('sys/autorun', shell.run)
return runDir('usr/autorun', shell.run) and s
end
return Opus