diff options
-rw-r--r-- | src/luarocks/fs/unix/tools.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/luarocks/fs/unix/tools.lua b/src/luarocks/fs/unix/tools.lua index 42e22060..efd4d624 100644 --- a/src/luarocks/fs/unix/tools.lua +++ b/src/luarocks/fs/unix/tools.lua | |||
@@ -81,7 +81,10 @@ end | |||
81 | -- plus an error message. | 81 | -- plus an error message. |
82 | function tools.copy_contents(src, dest) | 82 | function tools.copy_contents(src, dest) |
83 | assert(src and dest) | 83 | assert(src and dest) |
84 | if fs.execute_quiet(vars.CP.." -pPR "..fs.Q(src).."/* "..fs.Q(dest)) then | 84 | if not fs.is_dir(src) then |
85 | return false, src .. " is not a directory" | ||
86 | end | ||
87 | if fs.make_dir(dest) and fs.execute_quiet(vars.CP.." -pPR "..fs.Q(src).."/* "..fs.Q(dest)) then | ||
85 | return true | 88 | return true |
86 | else | 89 | else |
87 | return false, "Failed copying "..src.." to "..dest | 90 | return false, "Failed copying "..src.." to "..dest |