Add a mkdir function that is compatible to both unix and windows.

This commit is contained in:
Mark Crane
2013-04-12 18:27:56 +00:00
parent 049605a474
commit 7fde8c93d1

View File

@@ -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