Compare commits
8 Commits
d6e99c3042
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 20391f10df | |||
| 4d67656505 | |||
| 8e2fbe2c4f | |||
| b88e8121bb | |||
| 25d06d8f9d | |||
| d96d98e417 | |||
| 32a0eafb4f | |||
| fe19bd3ec4 |
@@ -1,8 +1,5 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
insert_final_newline = true
|
||||
|
||||
[*.lua]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
@@ -0,0 +1,2 @@
|
||||
/.settings
|
||||
/tmp/
|
||||
@@ -2,13 +2,12 @@
|
||||
|
||||
> [!WARNING]
|
||||
> Проект прямо сейчас в состоянии "альфа", существует только мининальный функционал, и в целом еще очень много вещей касаемо архитектуры под вопросом.
|
||||
>
|
||||
|
||||
HCF (H1N1's ComputerCraft Framework)- Фреймворк для ComputerCraft, который определяет и стандартизирует:
|
||||
- Местоположения таких файлов как:
|
||||
- Библиотеки (`/lib`)
|
||||
- Программы (`/bin`)
|
||||
- Временные файлы (`/tmp`)
|
||||
- Конфиги и прочие файлы (`/etc`)
|
||||
- Программы которые запускаются при включении (`/boot`)
|
||||
|
||||
|
||||
|
||||
@@ -6,13 +6,11 @@
|
||||
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
|
||||
|
||||
@@ -0,0 +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
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user