Skip to content

Commit 5764bc6

Browse files
mnriemCopilot
andcommitted
fix: only treat .specify as engine-owned when it is a real directory
A file or symlink named .specify should not be excluded from the non-empty check. Use entry.is_dir(follow_symlinks=False) to ensure only an actual directory is considered engine-owned content. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2d3920d commit 5764bc6

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/specify_cli/workflows/steps/init/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,11 @@ def execute(self, config: dict[str, Any], context: StepContext) -> StepResult:
129129
try:
130130
with os.scandir(base) as it:
131131
has_non_engine_content = any(
132-
entry.name not in _ENGINE_OWNED_DIRS for entry in it
132+
not (
133+
entry.name in _ENGINE_OWNED_DIRS
134+
and entry.is_dir(follow_symlinks=False)
135+
)
136+
for entry in it
133137
)
134138
except OSError as exc:
135139
error_message = (

0 commit comments

Comments
 (0)