-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakejvf-cmd.lua
36 lines (33 loc) · 948 Bytes
/
makejvf-cmd.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function mkdir(dir)
if os.type == "windows" then
dir = string.gsub(dir,"/","\\")
return os.execute("if not exist " .. dir .. " mkdir " .. dir)
else
return os.execute("mkdir -p " .. dir)
end
end
function rm(dir,file)
if os.type == "windows" then
dir = string.gsub(dir,"/","\\")
return os.execute("del /q " .. dir .. "\\" .. file)
else
return os.execute("rm -f " .. dir .. "/" .. file)
end
end
function cp(file,src,dest)
if os.type == "windows" then
src = string.gsub(src,"/","\\")
dest = string.gsub(dest,"/","\\")
return os.execute("copy /b /y " .. src .. "\\" .. file .. " " .. dest .. "\\")
else
return os.execute("cp -f " .. src .. "/" .. file .. " " .. dest .. "/")
end
end
function run(dir,cmd)
if os.type == "windows" then
dir = string.gsub(dir,"/","\\")
return os.execute("cd " .. dir .. " & " .. cmd)
else
return os.execute("cd " .. dir .. "; " .. cmd)
end
end