Skip to content

Commit

Permalink
Fix #3741 — symlink support in new plugin manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Kwpolska committed Jan 15, 2024
1 parent cec44ae commit 961abfb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Features
Bugfixes
--------

* Fix the new plugin manager not loading plugins if the plugin folder is a symlink (Issue #3741)
* Fix the ``nikola plugin`` command not working (Issue #3736)

New in v8.3.0
Expand Down
12 changes: 10 additions & 2 deletions nikola/plugin_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import importlib.util
import time
import sys

from collections import deque
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, List, Optional, Type, TYPE_CHECKING, Set
Expand Down Expand Up @@ -102,9 +104,15 @@ def locate_plugins(self) -> List[PluginCandidate]:
"""Locate plugins in plugin_places."""
self.candidates = []

plugin_folders: deque = deque([place for place in self.plugin_places if place.exists() and place.is_dir()])
plugin_files: List[Path] = []
for place in self.plugin_places:
plugin_files += place.rglob("*.plugin")
while plugin_folders:
base_folder = plugin_folders.popleft()
for item in base_folder.iterdir():
if item.is_dir():
plugin_folders.append(item)
elif item.suffix == ".plugin":
plugin_files.append(item)

for plugin_file in plugin_files:
source_dir = plugin_file.parent
Expand Down

0 comments on commit 961abfb

Please sign in to comment.