diff options
| -rw-r--r-- | src/luarocks/build.lua | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/luarocks/build.lua b/src/luarocks/build.lua index aa39ac9e..3c015920 100644 --- a/src/luarocks/build.lua +++ b/src/luarocks/build.lua | |||
| @@ -46,10 +46,18 @@ local function install_files(files, location, is_module_path) | |||
| 46 | if files then | 46 | if files then |
| 47 | for k, file in pairs(files) do | 47 | for k, file in pairs(files) do |
| 48 | local dest = location | 48 | local dest = location |
| 49 | if type(k) == "string" then | 49 | if is_module_path then |
| 50 | dest = is_module_path and dir.path(location, path.module_to_path(k)) or k | 50 | if type(k) == "string" then |
| 51 | dest = dir.path(location, path.module_to_path(k)) | ||
| 52 | end | ||
| 53 | fs.make_dir(dest) | ||
| 54 | else | ||
| 55 | if type(k) == "string" then | ||
| 56 | dest = dir.path(location, dir.dir_name(k)) | ||
| 57 | end | ||
| 58 | fs.make_dir(dest) | ||
| 59 | dest = dir.path(dest, dir.base_name(k)) | ||
| 51 | end | 60 | end |
| 52 | fs.make_dir(dest) | ||
| 53 | local ok = fs.copy(dir.path(file), dest) | 61 | local ok = fs.copy(dir.path(file), dest) |
| 54 | if not ok then | 62 | if not ok then |
| 55 | return nil, "Failed copying "..file | 63 | return nil, "Failed copying "..file |
