Skip to content

Commit 444daef

Browse files
fix: resolve core template from package bundle, not project .specify dir
1 parent 6a24268 commit 444daef

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/specify_cli/presets.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,15 @@ def _substitute_core_template(
4848
if "{CORE_TEMPLATE}" not in body:
4949
return body
5050

51-
core_file = project_root / ".specify" / "templates" / "commands" / f"{short_name}.md"
51+
from specify_cli import _locate_core_pack
52+
core_pack = _locate_core_pack()
53+
if core_pack is not None:
54+
core_file = core_pack / "commands" / f"{short_name}.md"
55+
else:
56+
# Source / editable install: look relative to the package root
57+
repo_root = Path(__file__).parent.parent.parent
58+
core_file = repo_root / "templates" / "commands" / f"{short_name}.md"
59+
5260
if not core_file.exists():
5361
return body
5462

0 commit comments

Comments
 (0)