File tree Expand file tree Collapse file tree 5 files changed +31
-7
lines changed
Expand file tree Collapse file tree 5 files changed +31
-7
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ branch_numbering: sequential
3737## Installation
3838
3939` ` ` bash
40- # Install from the bundled extension
41- specify extension add git --from extensions/git/
40+ # Install from the bundled extension directory
41+ specify extension add extensions/ git --dev
4242
4343# Or it auto-installs during specify init (migration period)
4444```
Original file line number Diff line number Diff line change @@ -209,6 +209,15 @@ if [ "$_common_loaded" != "true" ]; then
209209 exit 1
210210fi
211211
212+ # If only git-common.sh was loaded, verify that the required helpers
213+ # (resolve_template, json_escape) are available. These are provided by the
214+ # core common.sh; git-common.sh only supplies has_git / check_feature_branch.
215+ if ! type resolve_template > /dev/null 2>&1 || ! type json_escape > /dev/null 2>&1 ; then
216+ echo " Error: resolve_template/json_escape not defined. The core common.sh is required but could not be located." >&2
217+ echo " Tried: \$ SCRIPT_DIR/common.sh, .specify/scripts/bash/common.sh, scripts/bash/common.sh" >&2
218+ exit 1
219+ fi
220+
212221if git rev-parse --show-toplevel > /dev/null 2>&1 ; then
213222 REPO_ROOT=$( git rev-parse --show-toplevel)
214223 HAS_GIT=true
Original file line number Diff line number Diff line change @@ -179,6 +179,14 @@ if (-not $commonLoaded) {
179179 throw " Unable to locate common script file. Please ensure the Specify core scripts are installed."
180180}
181181
182+ # If only git-common.ps1 was loaded, verify that Resolve-Template is available.
183+ # Resolve-Template is provided by the core common.ps1; git-common.ps1 only
184+ # supplies Test-HasGit / Test-FeatureBranch.
185+ if (-not (Get-Command Resolve-Template - ErrorAction SilentlyContinue)) {
186+ throw (" Resolve-Template not defined. The core common.ps1 is required but could not be located. " +
187+ " Tried: $PSScriptRoot /common.ps1, .specify/scripts/powershell/common.ps1, scripts/powershell/common.ps1" )
188+ }
189+
182190try {
183191 $repoRoot = git rev- parse -- show-toplevel 2> $null
184192 if ($LASTEXITCODE -eq 0 ) {
Original file line number Diff line number Diff line change @@ -1188,7 +1188,8 @@ def _install_bundled_git_extension(project_path: Path) -> bool:
11881188 Before 1.0.0, this auto-install will be removed and the extension will
11891189 become opt-in.
11901190
1191- Returns True if the extension was installed, False otherwise.
1191+ Returns True if the extension was installed or already present,
1192+ False otherwise.
11921193 """
11931194 ext_source = _locate_bundled_git_extension ()
11941195 if ext_source is None :
@@ -1205,8 +1206,14 @@ def _install_bundled_git_extension(project_path: Path) -> bool:
12051206 speckit_ver = get_speckit_version ()
12061207 manager .install_from_directory (ext_source , speckit_ver )
12071208 return True
1208- except Exception :
1209- # Non-fatal: branching still works via core scripts during migration
1209+ except Exception as exc :
1210+ # Non-fatal: branching still works via core scripts during migration,
1211+ # but log a warning so users can tell the auto-install did not happen.
1212+ console .print (
1213+ "[dim yellow]Warning: failed to auto-install bundled git extension; "
1214+ "branching via the git extension may be unavailable. "
1215+ f"Details: { exc } [/dim yellow]"
1216+ )
12101217 return False
12111218
12121219
Original file line number Diff line number Diff line change @@ -88,8 +88,8 @@ Given that feature description, do this:
8888 - `mkdir -p "$FEATURE_DIR"`
8989 - `touch "$SPEC_FILE"`
9090 - PowerShell:
91- - `New-Item -ItemType Directory -Path $env: FEATURE_DIR -Force | Out-Null`
92- - `New-Item -ItemType File -Path $env: SPEC_FILE -Force | Out-Null`
91+ - `New-Item -ItemType Directory -Path $FEATURE_DIR -Force | Out-Null`
92+ - `New-Item -ItemType File -Path $SPEC_FILE -Force | Out-Null`
9393 - Then proceed directly to step 3 using `FEATURE_DIR` and `SPEC_FILE`
9494 - If the registry file does not exist, proceed with branch creation using the default behavior (backward compatibility)
9595
You can’t perform that action at this time.
0 commit comments