Skip to content

Commit

Permalink
copy recursively
Browse files Browse the repository at this point in the history
This allows for the inclusion of whole directories when specifying
supportfiles and the like.

For windows, xcopy is first able to copy recursively, enabled by /e. The
/i flag designates that the target is a directory. Depending on xcopy
instead of copy should not be too restrictive as it is available since
MS-DOS 3.3.
  • Loading branch information
dffischer committed Nov 5, 2015
1 parent ada1fab commit 5c435fb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions l3build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -434,11 +434,11 @@ function cp(glob, source, dest)
local source = source .. "/" .. i
if os_windows then
errorlevel = os.execute(
"copy /y " .. unix_to_win(source) .. " "
.. unix_to_win(dest) .. " > nul"
)
"xcopy /y /e /i" .. unix_to_win(source)
.. " " .. unix_to_win(dest) .. " > nul"
)
else
errorlevel = os.execute("cp -f " .. source .. " " .. dest)
errorlevel = os.execute("cp -rf " .. source .. " " .. dest)
end
if errorlevel ~=0 then
return errorlevel
Expand Down

0 comments on commit 5c435fb

Please sign in to comment.