aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Melnichenko <mpeterval@gmail.com>2016-05-08 13:58:01 +0300
committerPeter Melnichenko <mpeterval@gmail.com>2016-05-08 13:58:46 +0300
commita8fe9e376ee4517486513b47e7be143311c96e06 (patch)
tree7b4334579175365e47fd0f4dbc67e565abab957f
parentb4ff8c72d3935f5f0f8c7d0e8739115ca39a0c59 (diff)
downloadluarocks-a8fe9e376ee4517486513b47e7be143311c96e06.tar.gz
luarocks-a8fe9e376ee4517486513b47e7be143311c96e06.tar.bz2
luarocks-a8fe9e376ee4517486513b47e7be143311c96e06.zip
Fix some luacheck warnings in install.bat
-rw-r--r--install.bat9
1 files changed, 3 insertions, 6 deletions
diff --git a/install.bat b/install.bat
index 053fdfd6..df058585 100644
--- a/install.bat
+++ b/install.bat
@@ -55,7 +55,7 @@ local function die(message)
55 os.exit(1) 55 os.exit(1)
56end 56end
57 57
58function split_string(str, delim, maxNb) 58local function split_string(str, delim, maxNb)
59 -- Eliminate bad cases... 59 -- Eliminate bad cases...
60 if string.find(str, delim) == nil then 60 if string.find(str, delim) == nil then
61 return { str } 61 return { str }
@@ -543,8 +543,7 @@ local function look_for_lua_install ()
543 else 543 else
544 -- no prefix given, so use path 544 -- no prefix given, so use path
545 directories = (os.getenv("PATH",";") or "") 545 directories = (os.getenv("PATH",";") or "")
546 local i = 1 546 directories = directories:gsub(";+", ";") --remove all doubles
547 while i ~= 0 do directories, i = directories:gsub(";;",";") end --remove all doubles
548 directories = split_string(directories,";") 547 directories = split_string(directories,";")
549 -- if a path element ends with "\bin\" then remove it, as the searcher will check there anyway 548 -- if a path element ends with "\bin\" then remove it, as the searcher will check there anyway
550 for i, val in ipairs(directories) do 549 for i, val in ipairs(directories) do
@@ -651,7 +650,7 @@ local with_arg = { -- options followed by an argument, others are flags
651-- this will be damaged by the batch construction at the start of this file 650-- this will be damaged by the batch construction at the start of this file
652local oarg = arg -- retain old table 651local oarg = arg -- retain old table
653if #arg > 0 then 652if #arg > 0 then
654 farg = table.concat(arg, " ") .. " " 653 local farg = table.concat(arg, " ") .. " "
655 arg = {} 654 arg = {}
656 farg = farg:gsub('%"', "") 655 farg = farg:gsub('%"', "")
657 local i = 0 656 local i = 0
@@ -672,7 +671,6 @@ if #arg > 0 then
672 end 671 end
673end 672end
674for k,v in pairs(oarg) do if k < 1 then arg[k] = v end end -- copy 0 and negative indexes 673for k,v in pairs(oarg) do if k < 1 then arg[k] = v end end -- copy 0 and negative indexes
675oarg = nil
676 674
677-- build config option table with name and value elements 675-- build config option table with name and value elements
678local i = 1 676local i = 1
@@ -771,7 +769,6 @@ if not vars.TREE_ROOT then
771 end 769 end
772end 770end
773 771
774local datapath
775vars.SYSCONFDIR = vars.SYSCONFDIR or vars.PREFIX 772vars.SYSCONFDIR = vars.SYSCONFDIR or vars.PREFIX
776vars.SYSCONFFILENAME = S"config-$LUA_VERSION.lua" 773vars.SYSCONFFILENAME = S"config-$LUA_VERSION.lua"
777vars.CONFIG_FILE = vars.SYSCONFDIR.."\\"..vars.SYSCONFFILENAME 774vars.CONFIG_FILE = vars.SYSCONFDIR.."\\"..vars.SYSCONFFILENAME