Add a mkdir function that is compatible to both unix and windows.
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
--add the mkdir function
|
||||||
|
function mkdir(dir)
|
||||||
|
dir = dir:gsub("\\", "/");
|
||||||
|
if (package.config:sub(1,1) == "/") then
|
||||||
|
--unix
|
||||||
|
cmd = [[mkdir -p "]] .. dir .. [["]];
|
||||||
|
elseif (package.config:sub(1,1) == [[\]]) then
|
||||||
|
--windows
|
||||||
|
cmd = [[mkdir "]] .. dir .. [["]];
|
||||||
|
end
|
||||||
|
os.execute(cmd);
|
||||||
|
return cmd;
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user