mirror of
https://github.com/mt-mods/home_workshop_modpack.git
synced 2025-07-01 16:00:41 +02:00
add filesystem
This commit is contained in:
7
computers/commands/mkdir/conf.json
Normal file
7
computers/commands/mkdir/conf.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "mkdir",
|
||||
"license": "MIT",
|
||||
"version": 0.1,
|
||||
"engine": 0.4,
|
||||
"help": "makes a dir in the current path"
|
||||
}
|
12
computers/commands/mkdir/init.lua
Normal file
12
computers/commands/mkdir/init.lua
Normal file
@ -0,0 +1,12 @@
|
||||
function mkdir(pos, input, data)
|
||||
local path = computers.devicepath .. "/" .. minetest.hash_node_position(pos) .. data.element.pwd
|
||||
|
||||
if input and input ~= "" and not input:find("/") then
|
||||
minetest.mkdir(path .. "/" .. input)
|
||||
return "folder " .. input .. " created"
|
||||
else
|
||||
return "invalid or missing input"
|
||||
end
|
||||
end
|
||||
|
||||
return mkdir
|
Reference in New Issue
Block a user