From c8459585c9cb0f52d3a117125b537bd98f5515ab Mon Sep 17 00:00:00 2001 From: xpol Date: Tue, 3 Nov 2015 11:42:35 +0800 Subject: User assertion for required condition check. --- install.bat | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install.bat b/install.bat index 79b71645..ab8618b9 100644 --- a/install.bat +++ b/install.bat @@ -431,8 +431,8 @@ local function get_registry(key, value) return nil end --- requires vars.LUA_RUNTIME to be set before calling this function. local function get_visual_studio_directory() + assert(type(vars.LUA_RUNTIME)=="string", "requires vars.LUA_RUNTIME to be set before calling this function.") local major, minor = vars.LUA_RUNTIME:match('VCR%u*(%d+)(%d)$') -- MSVCR or VCRUNTIME if not major then return nil end local keys = { @@ -446,8 +446,8 @@ local function get_visual_studio_directory() return nil end --- requires vars.LUA_RUNTIME to be set before calling this function. local function get_windows_sdk_directory() + assert(type(vars.LUA_RUNTIME) == "string", "requires vars.LUA_RUNTIME to be set before calling this function.") -- Only v7.1 and v6.1 shipped with compilers -- Other versions requires a separate installation of Visual Studio. -- see https://github.com/keplerproject/luarocks/pull/443#issuecomment-152792516 @@ -464,8 +464,8 @@ local function get_windows_sdk_directory() return get_registry(key, "InstallationFolder") end -- returns the batch command to setup msvc compiler path. --- requires vars.LUA_RUNTIME and vars.UNAME_M to be set before calling this function. local function get_msvc_env_setup_cmd() + assert(type(vars.UNAME_M) == "string", "requires vars.UNAME_M to be set before calling this function.") local x64 = vars.UNAME_M=="x86_64" -- 1. try visual studio command line tools -- cgit v1.2.3-55-g6feb