summaryrefslogtreecommitdiffhomepage
path: root/plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugin.cpp')
-rw-r--r--plugin.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/plugin.cpp b/plugin.cpp
index 8e4182c..db0632d 100644
--- a/plugin.cpp
+++ b/plugin.cpp
@@ -60,13 +60,25 @@ bool PluginLoader::validate_config()
for (const auto& site: sites) {
for (const auto& path: site.paths) {
- if (path.type == Plugin) {
- std::string plugin {path.params.at("plugin")};
+ // path must contain target and plugin
+ auto it {path.params.find("target")};
+ if (it == path.params.end()) {
+ std::cout << "Path " << path.requested << " for site " << site.name << " is missing target specification." << std::endl;
+ return false;
+ }
- if (!m_plugins.contains(plugin)) {
- std::cout << "Configured plugin " << plugin << " not found" << std::endl;
- return false;
- }
+ it = path.params.find("plugin");
+ if (it == path.params.end()) {
+ std::cout << "Path " << path.requested << " for site " << site.name << " is missing plugin specification." << std::endl;
+ return false;
+ }
+
+ std::string plugin {it->second};
+
+ // check if plugin exists
+ if (!m_plugins.contains(plugin)) {
+ std::cout << "Configured plugin " << plugin << " not found" << std::endl;
+ return false;
}
}
}