Make _SCRIPT global available during debug manifest loading

This commit is contained in:
Jason Perkins 2014-04-03 14:57:40 -04:00
parent e2055a24d0
commit e3b03debfb

View File

@ -279,9 +279,13 @@ int load_builtin_scripts(lua_State* L)
return !OKAY; return !OKAY;
} }
/* load the manifest, which includes all the required scripts */ /* set the _SCRIPTS variable for the manifest, so it can locate everything */
scripts_path = lua_tostring(L, -1); scripts_path = lua_tostring(L, -1);
filename = lua_pushfstring(L, "%s/_manifest.lua", scripts_path); filename = lua_pushfstring(L, "%s/_manifest.lua", scripts_path);
lua_pushvalue(L, -1);
lua_setglobal(L, "_SCRIPT");
/* load the manifest, which includes all the required scripts */
if (luaL_dofile(L, filename)) if (luaL_dofile(L, filename))
{ {
printf(ERROR_MESSAGE, lua_tostring(L, -1)); printf(ERROR_MESSAGE, lua_tostring(L, -1));