Deduplicate component resolution probes
This commit is contained in:
+8
-3
@@ -2244,17 +2244,22 @@ private:
|
||||
if(current_dir != "" && current_dir != entry_dir)
|
||||
bases.push_back(current_dir + "/");
|
||||
}
|
||||
bases.push_back(worker.cfg.site_root + "/");
|
||||
String site_base = worker.cfg.site_root + "/";
|
||||
if(std::find(bases.begin(), bases.end(), site_base) == bases.end())
|
||||
bases.push_back(site_base);
|
||||
String normalized_file_name = normalize_component_path(file_name);
|
||||
|
||||
for(auto& base : bases)
|
||||
{
|
||||
std::vector<String> candidates;
|
||||
candidates.push_back(base + file_name);
|
||||
candidates.push_back(base + normalize_component_path(file_name));
|
||||
if(normalized_file_name != file_name)
|
||||
candidates.push_back(base + normalized_file_name);
|
||||
if(file_name.rfind("components/", 0) != 0 && base != "")
|
||||
{
|
||||
candidates.push_back(base + "components/" + file_name);
|
||||
candidates.push_back(base + "components/" + normalize_component_path(file_name));
|
||||
if(normalized_file_name != file_name)
|
||||
candidates.push_back(base + "components/" + normalized_file_name);
|
||||
}
|
||||
for(auto& candidate : candidates)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user