diff --git a/bootstrap/boot.lua b/bootstrap/boot.lua index f78be7186ddf7d8d2df53f58cbf5b663282e956d..d6f51d256b5a2a0d4bf156eb98716973ed5d6b47 100644 --- a/bootstrap/boot.lua +++ b/bootstrap/boot.lua @@ -11,8 +11,10 @@ if __SELFEXE then -- Remove bin/Debug from the path, to make dev easier dir = dir:gsub("bin"..fs.getPathSeparator().."Debug"..fs.getPathSeparator(), "") - -- Now remove executable name - dir = dir:gsub("(.*"..fs.getPathSeparator()..").+", "%1") + if not __APPLE__ then + -- Now remove executable name + dir = dir:gsub("(.*"..fs.getPathSeparator()..").+", "%1") + end print("SelfExe gave us app directory of:", dir) fs.mount(dir..fs.getPathSeparator().."game"..fs.getPathSeparator().."thirdparty", "/", true) diff --git a/src/main.c b/src/main.c index 5f17f6592c95199b28e66e071210080049c1c80c..4921c6db19cc8fa28529cabbfd36bcca2ab73898 100644 --- a/src/main.c +++ b/src/main.c @@ -462,6 +462,12 @@ int main(int argc, char *argv[]) lua_pushnil(L); lua_setglobal(L, "__SELFEXE"); + // Will be useful +#ifdef __APPLE__ + lua_pushboolean(L, TRUE); + lua_setglobal(L, "__APPLE__"); +#endif + // Run bootstrapping if (!luaL_loadfile(L, "/bootstrap/boot.lua")) {