Make shit less ass fuck shit fuck ass shit ass bruh what is this code
This commit is contained in:
+19
-10
@@ -1,14 +1,23 @@
|
||||
local directory = ...
|
||||
local fs = require("filesystem")
|
||||
local shell = require("shell")
|
||||
|
||||
if not directory then
|
||||
require("shell").run("help mkdir")
|
||||
return
|
||||
local args = {...}
|
||||
|
||||
if not args[1] then
|
||||
return shell.run("help mkdir")
|
||||
end
|
||||
if directory:sub(1, 1) ~= "/" then
|
||||
directory = fs.concat(require("shell").getWorkingDirectory(), directory)
|
||||
|
||||
for _, directory in pairs(args) do
|
||||
directory = shell.resolvePath(directory)
|
||||
|
||||
if fs.exists(directory) then
|
||||
terminal.write("\27[91mError: " .. directory ..": An object already exists\27[0m\n")
|
||||
goto continue
|
||||
end
|
||||
local what, err = fs.makeDirectory(directory)
|
||||
if err ~= nil then
|
||||
terminal.write("\27[91mError: " .. err .. "\27[0m\n")
|
||||
goto continue
|
||||
end
|
||||
::continue::
|
||||
end
|
||||
if fs.exists(directory) then
|
||||
print("\27[91mAn object already exists at the specified path.")
|
||||
end
|
||||
fs.makeDirectory(directory)
|
||||
|
||||
Reference in New Issue
Block a user