Adapt to changes in Ghoul that made absPath return a std::filesystem::path instead of a std::string

This commit is contained in:
Alexander Bock
2021-05-17 00:23:15 +02:00
parent ccdc5a5dc3
commit 92432caed2
102 changed files with 431 additions and 389 deletions

View File

@@ -144,7 +144,7 @@ void ScriptEngine::addLibrary(LuaLibrary library) {
}
}
for (const std::string& script : library.scripts) {
for (const std::filesystem::path& script : library.scripts) {
merged.scripts.push_back(script);
}
@@ -309,9 +309,9 @@ void ScriptEngine::addLibraryFunctions(lua_State* state, LuaLibrary& library,
lua_settable(state, TableOffset);
}
for (const std::string& script : library.scripts) {
for (const std::filesystem::path& script : library.scripts) {
// First we run the script to set its values in the current state
ghoul::lua::runScriptFile(state, script);
ghoul::lua::runScriptFile(state, script.string());
library.documentations.clear();
@@ -320,7 +320,7 @@ void ScriptEngine::addLibraryFunctions(lua_State* state, LuaLibrary& library,
lua_gettable(state, -2);
if (lua_isnil(state, -1)) {
LERROR(fmt::format(
"Module '{}' did not provide a documentation in script file '{}'",
"Module '{}' did not provide a documentation in script file {}",
library.name, script
));
}
@@ -637,7 +637,7 @@ bool ScriptEngine::writeLog(const std::string& script) {
if (!_logFileExists) {
// If a ScriptLogFile was specified, generate it now
if (!global::configuration->scriptLog.empty()) {
_logFilename = absPath(global::configuration->scriptLog);
_logFilename = absPath(global::configuration->scriptLog).string();
_logFileExists = true;
LDEBUG(fmt::format(