diff options
| author | Peter Melnichenko <mpeterval@gmail.com> | 2016-05-08 13:58:01 +0300 |
|---|---|---|
| committer | Peter Melnichenko <mpeterval@gmail.com> | 2016-05-08 13:58:46 +0300 |
| commit | a8fe9e376ee4517486513b47e7be143311c96e06 (patch) | |
| tree | 7b4334579175365e47fd0f4dbc67e565abab957f | |
| parent | b4ff8c72d3935f5f0f8c7d0e8739115ca39a0c59 (diff) | |
| download | luarocks-a8fe9e376ee4517486513b47e7be143311c96e06.tar.gz luarocks-a8fe9e376ee4517486513b47e7be143311c96e06.tar.bz2 luarocks-a8fe9e376ee4517486513b47e7be143311c96e06.zip | |
Fix some luacheck warnings in install.bat
| -rw-r--r-- | install.bat | 9 |
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) |
| 56 | end | 56 | end |
| 57 | 57 | ||
| 58 | function split_string(str, delim, maxNb) | 58 | local 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 |
| 652 | local oarg = arg -- retain old table | 651 | local oarg = arg -- retain old table |
| 653 | if #arg > 0 then | 652 | if #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 |
| 673 | end | 672 | end |
| 674 | for k,v in pairs(oarg) do if k < 1 then arg[k] = v end end -- copy 0 and negative indexes | 673 | for k,v in pairs(oarg) do if k < 1 then arg[k] = v end end -- copy 0 and negative indexes |
| 675 | oarg = nil | ||
| 676 | 674 | ||
| 677 | -- build config option table with name and value elements | 675 | -- build config option table with name and value elements |
| 678 | local i = 1 | 676 | local i = 1 |
| @@ -771,7 +769,6 @@ if not vars.TREE_ROOT then | |||
| 771 | end | 769 | end |
| 772 | end | 770 | end |
| 773 | 771 | ||
| 774 | local datapath | ||
| 775 | vars.SYSCONFDIR = vars.SYSCONFDIR or vars.PREFIX | 772 | vars.SYSCONFDIR = vars.SYSCONFDIR or vars.PREFIX |
| 776 | vars.SYSCONFFILENAME = S"config-$LUA_VERSION.lua" | 773 | vars.SYSCONFFILENAME = S"config-$LUA_VERSION.lua" |
| 777 | vars.CONFIG_FILE = vars.SYSCONFDIR.."\\"..vars.SYSCONFFILENAME | 774 | vars.CONFIG_FILE = vars.SYSCONFDIR.."\\"..vars.SYSCONFFILENAME |
