Skip to content

Commit 5e0767b

Browse files
committed
fix: include levelup extension in release packages
- Add extensions/levelup to release ZIP via create-release-packages.sh - Update install_bundled_extensions() to search multiple paths: 1. .specify/extensions/ (from extracted release ZIP) 2. Repository extensions/ directory (for development) - This ensures levelup commands are available after 'specify init'
1 parent d2e5f7c commit 5e0767b

2 files changed

Lines changed: 26 additions & 5 deletions

File tree

.github/workflows/scripts/create-release-packages.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,13 @@ build_variant() {
173173

174174
[[ -d templates ]] && { mkdir -p "$SPEC_DIR/templates"; find templates -type f -not -path "templates/commands/*" -not -name "vscode-settings.json" -exec cp --parents {} "$SPEC_DIR"/ \; ; echo "Copied templates -> .specify/templates"; }
175175

176+
# Copy bundled extensions (levelup is installed by default)
177+
if [[ -d extensions/levelup ]]; then
178+
mkdir -p "$SPEC_DIR/extensions"
179+
cp -r extensions/levelup "$SPEC_DIR/extensions/"
180+
echo "Copied extensions/levelup -> .specify/extensions"
181+
fi
182+
176183
# NOTE: We substitute {ARGS} internally. Outward tokens differ intentionally:
177184
# * Markdown/prompt (claude, copilot, cursor-agent, opencode): $ARGUMENTS
178185
# * TOML (gemini, qwen): {{args}}

src/specify_cli/__init__.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2764,21 +2764,35 @@ def install_bundled_extensions(
27642764
Currently installs:
27652765
- levelup: CDR-based team-ai-directives contribution workflow
27662766
2767+
Looks for extensions in the following locations (in order):
2768+
1. Project's .specify/extensions/ (bundled in release ZIP)
2769+
2. Repository's extensions/ directory (for development)
2770+
27672771
Args:
27682772
project_path: Target project directory
27692773
selected_ai: Selected AI assistant (for command registration)
27702774
tracker: Optional progress tracker
27712775
"""
27722776
from .extensions import ExtensionManager, ExtensionError
27732777

2774-
# Find the bundled extensions directory (relative to this module)
2775-
module_dir = Path(__file__).parent.parent.parent
2776-
bundled_extensions_dir = module_dir / "extensions"
2777-
27782778
# List of bundled extensions to install by default
27792779
bundled_extensions = ["levelup"]
27802780

2781-
if not bundled_extensions_dir.exists():
2781+
# Try multiple locations for bundled extensions
2782+
# 1. Project's .specify/extensions/ (from extracted release ZIP)
2783+
# 2. Repository's extensions/ directory (for development/testing)
2784+
bundled_extensions_dir = None
2785+
search_paths = [
2786+
project_path / ".specify" / "extensions", # Extracted from release ZIP
2787+
Path(__file__).parent.parent.parent / "extensions", # Dev: repo root
2788+
]
2789+
2790+
for path in search_paths:
2791+
if path.exists() and (path / "levelup" / "extension.yml").exists():
2792+
bundled_extensions_dir = path
2793+
break
2794+
2795+
if not bundled_extensions_dir:
27822796
if tracker:
27832797
tracker.skip("extensions", "bundled extensions not found")
27842798
return

0 commit comments

Comments
 (0)