aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-09-11 15:53:52 -0400
committerHisham Muhammad <hisham@gobolinux.org>2018-09-11 15:53:52 -0400
commitd9af1cf4bb17269d0120af66829d87b68ee03246 (patch)
tree003b40082922ac6be1d7d4929885b43e8545f076
parentad6c27862675b41df8b98a91ad547712ee17090d (diff)
downloadluarocks-d9af1cf4bb17269d0120af66829d87b68ee03246.tar.gz
luarocks-d9af1cf4bb17269d0120af66829d87b68ee03246.tar.bz2
luarocks-d9af1cf4bb17269d0120af66829d87b68ee03246.zip
fs.win32: fix wrapper generation when a folder with the same basename exists
Fixes #908.
-rw-r--r--src/luarocks/fs/win32.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/luarocks/fs/win32.lua b/src/luarocks/fs/win32.lua
index bb15ed28..f76f5f6e 100644
--- a/src/luarocks/fs/win32.lua
+++ b/src/luarocks/fs/win32.lua
@@ -139,8 +139,8 @@ function win32.wrap_script(file, dest, deps_mode, name, version, ...)
139 assert(type(name) == "string" or not name) 139 assert(type(name) == "string" or not name)
140 assert(type(version) == "string" or not version) 140 assert(type(version) == "string" or not version)
141 141
142 local wrapname = fs.is_dir(dest) and dest.."/"..dir.base_name(file) or dest 142 local batname = (file or dest) .. ".bat"
143 wrapname = wrapname .. ".bat" 143 local wrapname = fs.is_dir(dest) and dest.."/"..batname or batname
144 local wrapper = io.open(wrapname, "w") 144 local wrapper = io.open(wrapname, "w")
145 if not wrapper then 145 if not wrapper then
146 return nil, "Could not open "..wrapname.." for writing." 146 return nil, "Could not open "..wrapname.." for writing."