Added COPYFILE and COPYDIR tokens

This commit is contained in:
Sam Surtees 2020-10-02 16:24:34 +10:00
parent 796f517511
commit 802435304f

View File

@ -572,6 +572,12 @@
copy = function(v)
return "cp -rf " .. path.normalize(v)
end,
copyfile = function(v)
return "cp -f " .. path.normalize(v)
end,
copydir = function(v)
return "cp -rf " .. path.normalize(v)
end,
delete = function(v)
return "rm -f " .. path.normalize(v)
end,
@ -606,6 +612,17 @@
return "IF EXIST " .. src .. "\\ (xcopy /Q /E /Y /I " .. v .. " > nul) ELSE (xcopy /Q /Y /I " .. v .. " > nul)"
end,
copyfile = function(v)
v = path.translate(path.normalize(v))
-- XCOPY doesn't have a switch to assume destination is a file when it doesn't exist.
-- A trailing * will suppress the prompt but requires the file extensions be the same length.
-- Just use COPY instead, it actually works.
return "copy /B /Y " .. v
end,
copydir = function(v)
v = path.translate(path.normalize(v))
return "xcopy /Q /E /Y /I " .. v
end,
delete = function(v)
return "del " .. path.translate(path.normalize(v))
end,