-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b6ea5be
commit a2a2bd7
Showing
12 changed files
with
188 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: CraftOS-PC Action | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
sea: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: mkdir out | ||
run: mkdir out | ||
|
||
- name: CraftOS-PC >_ | ||
uses: Commandcracker/craftos-pc-action@v1 | ||
with: | ||
options: --mount-rw /out=./out | ||
--mount-ro /rom/autorun=./submodules/craftos-pc-tweaks/lua | ||
--mount-ro /lib/busted=./submodules/busted/busted | ||
--mount-ro /lib/system=./submodules/CC-LuaSystem/system | ||
--mount-ro /lib/luassert=./submodules/luassert/src | ||
--mount-ro /lib/lfs=./submodules/LuaFileSystem/lfs | ||
--mount-ro /lib/pl=./submodules/Penlight/lua/pl | ||
--mount-ro /lib/say=./submodules/say/src/say | ||
--mount-ro /lib/cliargs=./submodules/lua_cliargs/src/cliargs | ||
|
||
- name: upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: SEA | ||
path: out/install.lua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-- easy use ani colors with CC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
-- based on: https://pastebin.com/rxnjypsW | ||
local tArgs = { ... } | ||
|
||
local function get_program_name() | ||
if arg then | ||
return arg[0] | ||
end | ||
return fs.getName(shell.getRunningProgram()):gsub("[\\.].*$", "") | ||
end | ||
|
||
local isColour = term.isColour() | ||
|
||
if #tArgs ~= 2 then | ||
print("Usage: " .. get_program_name() .. " <directory> <archivename>") | ||
return | ||
end | ||
|
||
local sfxFiles = "" | ||
local sfxDirs = "" | ||
|
||
local root = tArgs[1] | ||
|
||
if root:sub(-1) ~= "/" then | ||
root = root .. "/" | ||
end | ||
|
||
local function serFile(fpath) | ||
sleep() -- yield | ||
print("file " .. root .. fpath) | ||
if fs.getSize(root .. fpath) > 1000000 then | ||
printError(root .. fpath .. " is too long, skipping") | ||
return | ||
end | ||
local file = fs.open(root .. fpath, "r") | ||
local text = file.readAll() | ||
file.close() | ||
sfxFiles = sfxFiles .. '"' .. fpath .. '",\n[=====[' .. text .. "]=====]" .. ",\n" | ||
end | ||
|
||
local function serDir(path) | ||
if isColour then | ||
term.setTextColour(colors.blue) | ||
end | ||
print("dir " .. root .. path) | ||
if isColour then | ||
term.setTextColour(colors.white) | ||
end | ||
local files = fs.list(root .. path) | ||
for _, file in ipairs(files) do | ||
local fpath = path .. file | ||
if fs.isDir(root .. fpath) then | ||
sfxDirs = sfxDirs .. '"' .. fpath .. '",\n' | ||
serDir(fpath .. "/") | ||
else | ||
serFile(fpath) | ||
end | ||
end | ||
end | ||
|
||
serDir("") | ||
|
||
local sfx = [[ | ||
local tArgs = { ... } | ||
local function get_program_name() | ||
if arg then | ||
return arg[0] | ||
end | ||
return fs.getName(shell.getRunningProgram()):gsub("[\\.].*$", "") | ||
end | ||
local isColour = term.isColour() | ||
if #tArgs ~= 1 then | ||
print("Usage: " .. get_program_name() .. " <dir>") | ||
return | ||
end | ||
local root = tArgs[1] | ||
if root:sub(-1) ~= "/" then | ||
root = root .. "/" | ||
end | ||
local files = { | ||
]] .. sfxFiles .. [[ | ||
} | ||
local dirs = {]] .. sfxDirs .. [[} | ||
if not fs.isDir(tArgs[1]) then | ||
fs.makeDir(tArgs[1]) | ||
end | ||
for _,dir in ipairs(dirs) do | ||
local fpath = root .. dir | ||
if isColour then | ||
term.setTextColour(colors.blue) | ||
end | ||
print("dir " .. fpath) | ||
if isColour then | ||
term.setTextColour(colors.white) | ||
end | ||
if not fs.isDir(fpath) then | ||
fs.makeDir(fpath) | ||
end | ||
end | ||
local i = 1 | ||
while i<#files do | ||
sleep() -- yield | ||
local fpath = root .. files[i] | ||
local data = files[i+1] | ||
print("file " .. fpath) | ||
local file = fs.open(fpath, "w") | ||
file.write(data) | ||
file.close() | ||
i = i+2 | ||
end]] | ||
|
||
local file = fs.open(tArgs[2], "w") | ||
file.write(sfx) | ||
file.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
shell.run("ccsfx /lib /out/install.lua") | ||
os.shutdown() |
Submodule busted
updated
3 files
+1 −1 | busted/core.lua | |
+1 −1 | busted/outputHandlers/gtest.lua | |
+10 −2 | busted/outputHandlers/json.lua |
Submodule craftos-pc-tweaks
updated
5 files
+84 −3 | README.md | |
+1 −0 | lua/exit_shell.lua | |
+0 −15 | lua/redirect_single.lua | |
+4 −0 | src/.settings | |
+4 −0 | src/startup.lua |
Submodule luassert
updated
5 files
+2 −2 | README.md | |
+2 −0 | spec/formatters_spec.lua | |
+23 −1 | spec/spies_spec.lua | |
+1 −1 | src/formatters/init.lua | |
+6 −1 | src/match.lua |