diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2024-02-26 17:47:46 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2024-02-27 13:28:33 -0300 |
commit | 5b2e63e6b087bdf626dd7cef319d6ba29f5e197c (patch) | |
tree | 2f3c28bf77e30eaf4073dedffc38ec811ac6901e | |
parent | 5cba4b83f60966045b86ac615df2692c953ebba7 (diff) | |
download | luarocks-5b2e63e6b087bdf626dd7cef319d6ba29f5e197c.tar.gz luarocks-5b2e63e6b087bdf626dd7cef319d6ba29f5e197c.tar.bz2 luarocks-5b2e63e6b087bdf626dd7cef319d6ba29f5e197c.zip |
fix(fs): make copy_contents behavior consistent on Unix
Make it match the win32 behavior.
-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 |