mirror of
https://github.com/github/spec-kit.git
synced 2026-03-20 12:23:09 +00:00
Applying review recommendations
This commit is contained in:
@@ -225,6 +225,8 @@ except Exception:
|
|||||||
local core="$base/${template_name}.md"
|
local core="$base/${template_name}.md"
|
||||||
[ -f "$core" ] && echo "$core" && return 0
|
[ -f "$core" ] && echo "$core" && return 0
|
||||||
|
|
||||||
return 1
|
# Return success with empty output so callers using set -e don't abort;
|
||||||
|
# callers check [ -n "$TEMPLATE" ] to detect "not found".
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ function Resolve-Template {
|
|||||||
$presets = $registryData.presets
|
$presets = $registryData.presets
|
||||||
if ($presets) {
|
if ($presets) {
|
||||||
$sortedPresets = $presets.PSObject.Properties |
|
$sortedPresets = $presets.PSObject.Properties |
|
||||||
Sort-Object { if ($_.Value.priority) { $_.Value.priority } else { 10 } } |
|
Sort-Object { if ($null -ne $_.Value.priority) { $_.Value.priority } else { 10 } } |
|
||||||
ForEach-Object { $_.Name }
|
ForEach-Object { $_.Name }
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
@@ -739,7 +739,10 @@ class CommandRegistrar:
|
|||||||
return self._registrar.render_frontmatter(frontmatter) + "\n" + context_note + body
|
return self._registrar.render_frontmatter(frontmatter) + "\n" + context_note + body
|
||||||
|
|
||||||
def _render_toml_command(self, frontmatter, body, ext_id):
|
def _render_toml_command(self, frontmatter, body, ext_id):
|
||||||
return self._registrar.render_toml_command(frontmatter, body, ext_id)
|
# Preserve extension-specific context comments for backward compatibility
|
||||||
|
base = self._registrar.render_toml_command(frontmatter, body, ext_id)
|
||||||
|
context_lines = f"# Extension: {ext_id}\n# Config: .specify/extensions/{ext_id}/\n"
|
||||||
|
return base.rstrip("\n") + "\n" + context_lines
|
||||||
|
|
||||||
def register_commands_for_agent(
|
def register_commands_for_agent(
|
||||||
self,
|
self,
|
||||||
|
|||||||
@@ -1351,11 +1351,11 @@ class PresetCatalog:
|
|||||||
raise PresetError(f"Failed to save preset ZIP: {e}")
|
raise PresetError(f"Failed to save preset ZIP: {e}")
|
||||||
|
|
||||||
def clear_cache(self):
|
def clear_cache(self):
|
||||||
"""Clear the catalog cache."""
|
"""Clear all catalog cache files, including per-URL hashed caches."""
|
||||||
if self.cache_file.exists():
|
if self.cache_dir.exists():
|
||||||
self.cache_file.unlink()
|
for f in self.cache_dir.iterdir():
|
||||||
if self.cache_metadata_file.exists():
|
if f.is_file() and f.name.startswith("catalog"):
|
||||||
self.cache_metadata_file.unlink()
|
f.unlink(missing_ok=True)
|
||||||
|
|
||||||
|
|
||||||
class PresetResolver:
|
class PresetResolver:
|
||||||
|
|||||||
Reference in New Issue
Block a user