mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Add a mkdir function that is compatible to both unix and windows.
This commit is contained in:
14
includes/install/scripts/resources/functions/mkdir.lua
Normal file
14
includes/install/scripts/resources/functions/mkdir.lua
Normal 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
|
||||
Reference in New Issue
Block a user