mirror of
https://github.com/github/spec-kit.git
synced 2026-03-24 14:23:09 +00:00
fix: address second round of review comments
1. Log warning on auto-install failure instead of silent catch 2. Fix README install command (--from → --dev) 3. Bash: fail fast if resolve_template/json_escape unavailable after git-common.sh fallback 4. PowerShell: fail fast if Resolve-Template unavailable after git-common.ps1 fallback 5. Fix PowerShell $env:FEATURE_DIR → $FEATURE_DIR in specify.md 6. Fix docstring to reflect already-installed return value Co-authored-by: mnriem <15701806+mnriem@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/spec-kit/sessions/6bcb7cb8-c7da-49d6-8206-1187766f92e1
This commit is contained in:
committed by
GitHub
parent
17810c8e85
commit
4f1b63a65a
@@ -37,8 +37,8 @@ branch_numbering: sequential
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
# Install from the bundled extension
|
||||
specify extension add git --from extensions/git/
|
||||
# Install from the bundled extension directory
|
||||
specify extension add extensions/git --dev
|
||||
|
||||
# Or it auto-installs during specify init (migration period)
|
||||
```
|
||||
|
||||
@@ -209,6 +209,15 @@ if [ "$_common_loaded" != "true" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# If only git-common.sh was loaded, verify that the required helpers
|
||||
# (resolve_template, json_escape) are available. These are provided by the
|
||||
# core common.sh; git-common.sh only supplies has_git / check_feature_branch.
|
||||
if ! type resolve_template >/dev/null 2>&1 || ! type json_escape >/dev/null 2>&1; then
|
||||
echo "Error: resolve_template/json_escape not defined. The core common.sh is required but could not be located." >&2
|
||||
echo "Tried: \$SCRIPT_DIR/common.sh, .specify/scripts/bash/common.sh, scripts/bash/common.sh" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if git rev-parse --show-toplevel >/dev/null 2>&1; then
|
||||
REPO_ROOT=$(git rev-parse --show-toplevel)
|
||||
HAS_GIT=true
|
||||
|
||||
@@ -179,6 +179,14 @@ if (-not $commonLoaded) {
|
||||
throw "Unable to locate common script file. Please ensure the Specify core scripts are installed."
|
||||
}
|
||||
|
||||
# If only git-common.ps1 was loaded, verify that Resolve-Template is available.
|
||||
# Resolve-Template is provided by the core common.ps1; git-common.ps1 only
|
||||
# supplies Test-HasGit / Test-FeatureBranch.
|
||||
if (-not (Get-Command Resolve-Template -ErrorAction SilentlyContinue)) {
|
||||
throw ("Resolve-Template not defined. The core common.ps1 is required but could not be located. " +
|
||||
"Tried: $PSScriptRoot/common.ps1, .specify/scripts/powershell/common.ps1, scripts/powershell/common.ps1")
|
||||
}
|
||||
|
||||
try {
|
||||
$repoRoot = git rev-parse --show-toplevel 2>$null
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
|
||||
Reference in New Issue
Block a user