mirror of
https://github.com/mt-mods/home_workshop_modpack.git
synced 2024-11-15 23:20:22 +01:00
meow
This commit is contained in:
parent
aca2f138a8
commit
c46ec76c63
7
computers/commands/cat/conf.json
Normal file
7
computers/commands/cat/conf.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"name": "cat",
|
||||
"license": "MIT",
|
||||
"version": 0.1,
|
||||
"engine": 0.44,
|
||||
"help": "output file to the terminal"
|
||||
}
|
15
computers/commands/cat/init.lua
Normal file
15
computers/commands/cat/init.lua
Normal file
|
@ -0,0 +1,15 @@
|
|||
function cat(pos, input, data)
|
||||
local path = computers.devicepath .. "/" .. minetest.hash_node_position(pos) .. data.element.pwd
|
||||
local files = computers.api.get_dir_keyed_list(path, false)
|
||||
|
||||
if files[input] then
|
||||
local f = io.open(path .. "/" .. input)
|
||||
local fdata = f:read("*all")
|
||||
f:close()
|
||||
return fdata
|
||||
else
|
||||
return "file not found"
|
||||
end
|
||||
end
|
||||
|
||||
return cat
|
|
@ -8,7 +8,7 @@ minetest.mkdir(computers.devicepath) --make sure it exists
|
|||
minetest.mkdir(computers.networkpath) --make sure it exists
|
||||
|
||||
computers.os = {
|
||||
version = 0.43,
|
||||
version = 0.44,
|
||||
name = "kuto",
|
||||
authors = {"wsor", "luk3yx"},
|
||||
license = "MIT",
|
||||
|
|
Loading…
Reference in New Issue
Block a user