# HG changeset patch # User jbe # Date 1427062098 -3600 # Node ID d34b7b5e5e5c76927c4507e328b932d9fc53d38d # Parent 3181d410437cb0e7efddf0034391c75c8f631083 Check if framework path is correct in mcp.lua (gives a more helpful error message if the framework path is wrong) diff -r 3181d410437c -r d34b7b5e5e5c framework/bin/mcp.lua --- a/framework/bin/mcp.lua Sun Mar 22 22:55:04 2015 +0100 +++ b/framework/bin/mcp.lua Sun Mar 22 23:08:18 2015 +0100 @@ -133,6 +133,19 @@ end end +-- check if framework path is correct +do + local file, errmsg = io.open(WEBMCP_FRAMEWORK_PATH .. "webmcp_version", "r") + if not file then + error('Could not find "webmcp_version" file: ' .. errmsg, 0) + end + local version = assert(file:read()) + assert(file:close()) + if version ~= WEBMCP_VERSION then + error('Version mismatch in file "' .. WEBMCP_FRAMEWORK_PATH .. 'webmcp_version"') + end +end + -- setup search paths for libraries do if string.match(package.path, "^[^;]") then