mirror of
https://github.com/mt-mods/home_workshop_modpack.git
synced 2025-07-04 01:10:36 +02:00
add filesystem
This commit is contained in:
7
computers/commands/ls/conf.json
Normal file
7
computers/commands/ls/conf.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "ls",
|
||||
"license": "MIT",
|
||||
"version": 0.1,
|
||||
"engine": 0.4,
|
||||
"help": "lists out all files and folders in the current path"
|
||||
}
|
9
computers/commands/ls/init.lua
Normal file
9
computers/commands/ls/init.lua
Normal file
@ -0,0 +1,9 @@
|
||||
function ls(pos, input, data)
|
||||
local path = computers.devicepath .. "/" .. minetest.hash_node_position(pos) .. data.element.pwd
|
||||
--make dir to be safe
|
||||
minetest.mkdir(path)
|
||||
|
||||
return table.concat(minetest.get_dir_list(path), " ")
|
||||
end
|
||||
|
||||
return ls
|
Reference in New Issue
Block a user