Skip to content
Snippets Groups Projects
Verified Commit 111c8ebd authored by Timm Fitschen's avatar Timm Fitschen
Browse files

Fix load_string_file

parent 3b739b68
Branches
Tags
2 merge requests!33Release 0.1,!32fix windows build
Pipeline #15220 failed
......@@ -84,9 +84,9 @@ auto getEnumValueFromName<caosdb::entity::Role>(const std::string &name) -> caos
/**
* @brief Read a text file into a string and return the file's content.
*/
inline auto load_string_file(const std::string &file_path) -> std::string {
inline auto load_string_file(const path &file_path) -> std::string {
std::string result;
boost::filesystem::load_string_file(file_path, result);
boost::filesystem::load_string_file(file_path.string(), result);
return result;
}
......
......@@ -471,12 +471,12 @@ auto ConfigurationManager::InitializeDefaults() -> int { // NOLINT
configuration_file_path = std::make_unique<path>();
const path raw(configuration_file);
// resolve home directory
for (auto segment = raw.begin(); segment != raw.end(); ++segment) {
if (segment->string() == "$HOME") {
for (const auto &segment : raw) {
if (segment.string() == "$HOME") {
path expanded_home(get_home_directory());
*configuration_file_path /= expanded_home;
} else {
*configuration_file_path /= *segment;
*configuration_file_path /= segment;
}
}
if (exists(*configuration_file_path)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment