From b6e056a671b721a1a51b4ad9b3b1599cc8c98f9a Mon Sep 17 00:00:00 2001 From: mpeterv Date: Mon, 28 Mar 2016 20:55:57 +0300 Subject: [PATCH] Install luarocks .bat files correctly for older versions --- hererocks.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hererocks.py b/hererocks.py index 058e8f1..5d4c16b 100755 --- a/hererocks.py +++ b/hererocks.py @@ -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,