mirror of
https://github.com/mt-mods/home_workshop_modpack.git
synced 2025-07-01 07:50:39 +02:00
priv gate things + bugfixes
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "cd",
|
||||
"license": "MIT",
|
||||
"version": 0.1,
|
||||
"engine": 0.4,
|
||||
"version": 0.11,
|
||||
"engine": 0.41,
|
||||
"help": "move in and out of folders"
|
||||
}
|
@ -1,4 +1,7 @@
|
||||
function cd(pos, input, data)
|
||||
if not minetest.check_player_privs(data.player, "computers_filesystem") then
|
||||
return "ERROR: permision denied"
|
||||
end
|
||||
local path = computers.devicepath .. "/" .. minetest.hash_node_position(pos) .. data.element.pwd
|
||||
|
||||
if input and input ~= "" and not input:find("/") and not input:find("\\") then
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "mkdir",
|
||||
"license": "MIT",
|
||||
"version": 0.1,
|
||||
"engine": 0.4,
|
||||
"version": 0.11,
|
||||
"engine": 0.41,
|
||||
"help": "makes a dir in the current path"
|
||||
}
|
@ -1,4 +1,7 @@
|
||||
function mkdir(pos, input, data)
|
||||
if not minetest.check_player_privs(data.player, "computers_filesystem") then
|
||||
return "ERROR: permision denied"
|
||||
end
|
||||
local path = computers.devicepath .. "/" .. minetest.hash_node_position(pos) .. data.element.pwd
|
||||
|
||||
if input and input ~= "" and not input:find("/") and not input:find("\\") then
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "touch",
|
||||
"license": "MIT",
|
||||
"version": 0.1,
|
||||
"version": 0.2,
|
||||
"engine": 0.4,
|
||||
"help": "creates a file in the current path"
|
||||
}
|
@ -4,6 +4,11 @@ function touch(pos, input, data)
|
||||
minetest.mkdir(path)
|
||||
|
||||
if input and input ~= "" and not input:find("/") then
|
||||
for _, item in pairs(minetest.get_dir_list(path, nil)) do
|
||||
if item == input then
|
||||
return "ERROR: trying to create already existing file/folder"
|
||||
end
|
||||
end
|
||||
minetest.safe_file_write(path .. "/" .. input, "")
|
||||
return "file " .. input .. " created"
|
||||
else
|
||||
|
Reference in New Issue
Block a user