mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-25 23:05:58 +01:00
config: report errors from sourced files
This commit is contained in:
parent
220144276b
commit
66330281ff
1 changed files with 9 additions and 2 deletions
|
@ -2243,6 +2243,8 @@ std::optional<std::string> CConfigManager::handleSource(const std::string& comma
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string errorsFromParsing;
|
||||||
|
|
||||||
for (size_t i = 0; i < glob_buf->gl_pathc; i++) {
|
for (size_t i = 0; i < glob_buf->gl_pathc; i++) {
|
||||||
auto value = absolutePath(glob_buf->gl_pathv[i], configCurrentPath);
|
auto value = absolutePath(glob_buf->gl_pathv[i], configCurrentPath);
|
||||||
|
|
||||||
|
@ -2268,12 +2270,17 @@ std::optional<std::string> CConfigManager::handleSource(const std::string& comma
|
||||||
auto configCurrentPathBackup = configCurrentPath;
|
auto configCurrentPathBackup = configCurrentPath;
|
||||||
configCurrentPath = value;
|
configCurrentPath = value;
|
||||||
|
|
||||||
m_pConfig->parseFile(value.c_str());
|
const auto THISRESULT = m_pConfig->parseFile(value.c_str());
|
||||||
|
|
||||||
configCurrentPath = configCurrentPathBackup;
|
configCurrentPath = configCurrentPathBackup;
|
||||||
|
|
||||||
|
if (THISRESULT.error && errorsFromParsing.empty())
|
||||||
|
errorsFromParsing += THISRESULT.getError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (errorsFromParsing.empty())
|
||||||
return {};
|
return {};
|
||||||
|
return errorsFromParsing;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<std::string> CConfigManager::handleEnv(const std::string& command, const std::string& value) {
|
std::optional<std::string> CConfigManager::handleEnv(const std::string& command, const std::string& value) {
|
||||||
|
|
Loading…
Reference in a new issue