File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,20 @@ def _substitute_core_template(
4848 if "{CORE_TEMPLATE}" not in body :
4949 return body
5050
51+ # Prefer the project's installed core template so project-level commands and
52+ # customisations are wrapped correctly. Fall back to the bundled core_pack or
53+ # repo templates for commands that ship with the package.
5154 core_file = project_root / ".specify" / "templates" / "commands" / f"{ short_name } .md"
55+ if not core_file .exists ():
56+ from specify_cli import _locate_core_pack
57+ core_pack = _locate_core_pack ()
58+ if core_pack is not None :
59+ core_file = core_pack / "commands" / f"{ short_name } .md"
60+ else :
61+ # Source / editable install: look relative to the package root
62+ repo_root = Path (__file__ ).parent .parent .parent
63+ core_file = repo_root / "templates" / "commands" / f"{ short_name } .md"
64+
5265 if not core_file .exists ():
5366 return body
5467
You can’t perform that action at this time.
0 commit comments