From fd17f51959b0a43467ae51303390abeacd3f907e Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Fri, 16 Apr 2021 13:11:33 +0200 Subject: [PATCH] Fix Taskrunner compile error (closes #1554) --- apps/TaskRunner/main.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/TaskRunner/main.cpp b/apps/TaskRunner/main.cpp index 76b37e0f5e..7e038fe34d 100644 --- a/apps/TaskRunner/main.cpp +++ b/apps/TaskRunner/main.cpp @@ -122,7 +122,13 @@ int main(int argc, char** argv) { ); std::string configFile = configuration::findConfiguration(); - *global::configuration = configuration::loadConfigurationFromFile(configFile); + + // Register the base path as the directory where the configuration file lives + std::string base = ghoul::filesystem::File(configFile).directoryName(); + constexpr const char* BasePathToken = "${BASE}"; + FileSys.registerPathToken(BasePathToken, base); + + *global::configuration = configuration::loadConfigurationFromFile(configFile, ""); openspace::global::openSpaceEngine->registerPathTokens(); global::openSpaceEngine->initialize(); @@ -131,7 +137,7 @@ int main(int argc, char** argv) { ghoul::cmdparser::CommandlineParser::AllowUnknownCommands::Yes ); - std::string tasksPath = ""; + std::string tasksPath; commandlineParser.addCommand( std::make_unique>( tasksPath, @@ -146,7 +152,7 @@ int main(int argc, char** argv) { //FileSys.setCurrentDirectory(launchDirectory); - if (tasksPath != "") { + if (!tasksPath.empty()) { performTasks(tasksPath); return 0; }