Skip to content

Commit 1a0f8b1

Browse files
committed
Applying review recommendations
1 parent db66637 commit 1a0f8b1

4 files changed

Lines changed: 13 additions & 8 deletions

File tree

scripts/bash/common.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ except Exception:
225225
local core="$base/${template_name}.md"
226226
[ -f "$core" ] && echo "$core" && return 0
227227

228-
return 1
228+
# Return success with empty output so callers using set -e don't abort;
229+
# callers check [ -n "$TEMPLATE" ] to detect "not found".
230+
return 0
229231
}
230232

scripts/powershell/common.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ function Resolve-Template {
163163
$presets = $registryData.presets
164164
if ($presets) {
165165
$sortedPresets = $presets.PSObject.Properties |
166-
Sort-Object { if ($_.Value.priority) { $_.Value.priority } else { 10 } } |
166+
Sort-Object { if ($null -ne $_.Value.priority) { $_.Value.priority } else { 10 } } |
167167
ForEach-Object { $_.Name }
168168
}
169169
} catch {

src/specify_cli/extensions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,10 @@ def _render_markdown_command(self, frontmatter, body, ext_id):
739739
return self._registrar.render_frontmatter(frontmatter) + "\n" + context_note + body
740740

741741
def _render_toml_command(self, frontmatter, body, ext_id):
742-
return self._registrar.render_toml_command(frontmatter, body, ext_id)
742+
# Preserve extension-specific context comments for backward compatibility
743+
base = self._registrar.render_toml_command(frontmatter, body, ext_id)
744+
context_lines = f"# Extension: {ext_id}\n# Config: .specify/extensions/{ext_id}/\n"
745+
return base.rstrip("\n") + "\n" + context_lines
743746

744747
def register_commands_for_agent(
745748
self,

src/specify_cli/presets.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,11 +1351,11 @@ def download_pack(
13511351
raise PresetError(f"Failed to save preset ZIP: {e}")
13521352

13531353
def clear_cache(self):
1354-
"""Clear the catalog cache."""
1355-
if self.cache_file.exists():
1356-
self.cache_file.unlink()
1357-
if self.cache_metadata_file.exists():
1358-
self.cache_metadata_file.unlink()
1354+
"""Clear all catalog cache files, including per-URL hashed caches."""
1355+
if self.cache_dir.exists():
1356+
for f in self.cache_dir.iterdir():
1357+
if f.is_file() and f.name.startswith("catalog"):
1358+
f.unlink(missing_ok=True)
13591359

13601360

13611361
class PresetResolver:

0 commit comments

Comments
 (0)