Files
Halyde/halyde/apps/mkdir.lua
T
Ponali 3c087aaddf added handling invalid invoke functions and ported a couple of apps
stopped component.invoke from throwing a cryptic error, and ported over cat, cd, clear, cp, edit, ls, lsdrv, and mkdir
2025-09-14 17:45:36 +02:00

15 lines
369 B
Lua

local directory = ...
local fs = require("filesystem")
if not directory then
require("shell").run("help mkdir")
return
end
if directory:sub(1, 1) ~= "/" then
directory = fs.concat(require("shell").getWorkingDirectory(), directory)
end
if fs.exists(directory) then
print("\27[91mAn object already exists at the specified path.")
end
fs.makeDirectory(directory)