webmcp
changeset 313:d34b7b5e5e5c
Check if framework path is correct in mcp.lua (gives a more helpful error message if the framework path is wrong)
author | jbe |
---|---|
date | Sun Mar 22 23:08:18 2015 +0100 (2015-03-22) |
parents | 3181d410437c |
children | ba68ef9e7c90 |
files | framework/bin/mcp.lua |
line diff
1.1 --- a/framework/bin/mcp.lua Sun Mar 22 22:55:04 2015 +0100 1.2 +++ b/framework/bin/mcp.lua Sun Mar 22 23:08:18 2015 +0100 1.3 @@ -133,6 +133,19 @@ 1.4 end 1.5 end 1.6 1.7 +-- check if framework path is correct 1.8 +do 1.9 + local file, errmsg = io.open(WEBMCP_FRAMEWORK_PATH .. "webmcp_version", "r") 1.10 + if not file then 1.11 + error('Could not find "webmcp_version" file: ' .. errmsg, 0) 1.12 + end 1.13 + local version = assert(file:read()) 1.14 + assert(file:close()) 1.15 + if version ~= WEBMCP_VERSION then 1.16 + error('Version mismatch in file "' .. WEBMCP_FRAMEWORK_PATH .. 'webmcp_version"') 1.17 + end 1.18 +end 1.19 + 1.20 -- setup search paths for libraries 1.21 do 1.22 if string.match(package.path, "^[^;]") then