Install luarocks .bat files correctly for older versions

This commit is contained in:
mpeterv 2016-03-28 20:55:57 +03:00
parent bf6026cb70
commit b6e056a671

View File

@ -902,9 +902,12 @@ class LuaRocks(Program):
run(args)
for script in ["luarocks.bat", "luarocks-admin.bat"]:
shutil.copy(
os.path.join(opts.location, "luarocks", script),
os.path.join(opts.location, "bin"))
for subdir in [".", "2.2", "2.1", "2.0"]:
script_path = os.path.join(opts.location, "luarocks", subdir, script)
if os.path.exists(script_path):
shutil.copy(script_path, os.path.join(opts.location, "bin"))
break
else:
print("Building LuaRocks" + self.version_suffix)
run("./configure", "--prefix=" + opts.location,