Compare commits

..

6 Commits

Author SHA1 Message Date
h1n1 20391f10df .editorconfig - удалил наверное бесполезную строку 2026-07-26 17:24:36 +00:00
h1n1 4d67656505 Добавление /bin в shell.path 2026-07-26 18:34:38 +07:00
h1n1 8e2fbe2c4f Временное обновление README
Пока что решил убрать то что не сделано в самом проекте.
2026-07-26 11:21:15 +00:00
h1n1 b88e8121bb Фикс форматирования 2026-07-26 11:19:50 +00:00
h1n1 25d06d8f9d Фикс форматирования 2026-07-26 11:17:43 +00:00
h1n1 d96d98e417 Обновил .gitignore 2026-07-26 11:16:48 +00:00
6 changed files with 36 additions and 35 deletions
-3
View File
@@ -1,8 +1,5 @@
root = true
[*]
insert_final_newline = true
[*.lua]
indent_style = space
indent_size = 2
+2 -1
View File
@@ -1 +1,2 @@
.settings
/.settings
/tmp/
+1 -2
View File
@@ -2,13 +2,12 @@
> [!WARNING]
> Проект прямо сейчас в состоянии "альфа", существует только мининальный функционал, и в целом еще очень много вещей касаемо архитектуры под вопросом.
>
HCF (H1N1's ComputerCraft Framework)- Фреймворк для ComputerCraft, который определяет и стандартизирует:
- Местоположения таких файлов как:
- Библиотеки (`/lib`)
- Программы (`/bin`)
- Временные файлы (`/tmp`)
- Конфиги и прочие файлы (`/etc`)
- Программы которые запускаются при включении (`/boot`)
+20 -22
View File
@@ -5,30 +5,28 @@
local function listdir(path, findpattern)
local list = fs.list(path)
for k, v in pairs(list) do
filename = path .. "/" .. v
if fs.isDir(filename) then
listdir(filename, findpattern)
else
if findpattern then
local s, e = filename:find(findpattern)
if s then
local ls = filename:sub(1, s-1)
local h = filename:sub(s, e)
local le = filename:sub(e+1)
local defcolor = term.getTextColor()
write(ls)
term.setTextColor(colors.red)
write(h)
term.setTextColor(defcolor)
print(le)
end
end
local list = fs.list(path)
for k, v in pairs(list) do
filename = path .. "/" .. v
if fs.isDir(filename) then
listdir(filename, findpattern)
else
if findpattern then
local s, e = filename:find(findpattern)
if s then
local ls = filename:sub(1, s-1)
local h = filename:sub(s, e)
local le = filename:sub(e+1)
local defcolor = term.getTextColor()
write(ls)
term.setTextColor(colors.red)
write(h)
term.setTextColor(defcolor)
print(le)
end
end
end
end
end
+4 -7
View File
@@ -1,12 +1,9 @@
-- /tmp folder cleanup
if fs.exists("/tmp") then
local list = fs.list("/tmp")
for k, v in pairs(list) do
fs.delete("/tmp/" .. v)
end
local list = fs.list("/tmp")
for k, v in pairs(list) do
fs.delete("/tmp/" .. v)
end
end
+9
View File
@@ -1,6 +1,7 @@
print("--- HCF ---")
print()
-- Colored print for code readability
local function printcolor(text, clr)
local old = term.getTextColor()
@@ -9,6 +10,14 @@ local function printcolor(text, clr)
term.setTextColor(old)
end
printcolor("Adding /bin to PATH...", colors.gray)
do
local old = shell.path()
local new = old .. ":/bin"
shell.setPath(new)
end
printcolor("Checking boot folder...", colors.gray)
-- Boot folder check
if fs.exists("/boot") then
for _, name in pairs(fs.list("/boot")) do