@@ -27,14 +27,6 @@ echo "Building release packages for $NEW_VERSION"
2727
2828rm -rf sdd-package-base* sdd-* -package-* spec-kit-template-* -${NEW_VERSION} .zip || true
2929
30- mkdir -p sdd-package-base
31- SPEC_DIR=" sdd-package-base/.specify"
32- mkdir -p " $SPEC_DIR "
33-
34- [[ -d memory ]] && { cp -r memory " $SPEC_DIR /" ; echo " Copied memory -> .specify" ; }
35- [[ -d scripts ]] && { cp -r scripts " $SPEC_DIR /" ; echo " Copied scripts -> .specify/scripts" ; }
36- [[ -d templates ]] && { mkdir -p " $SPEC_DIR /templates" ; find templates -type f -not -path " templates/commands/*" -exec cp --parents {} " $SPEC_DIR " / \; ; echo " Copied templates -> .specify/templates" ; }
37-
3830rewrite_paths () {
3931 sed -E \
4032 -e ' s@(/?)memory/@.specify/memory/@g' \
@@ -93,7 +85,31 @@ build_variant() {
9385 local base_dir=" sdd-${agent} -package-${script} "
9486 echo " Building $agent ($script ) package..."
9587 mkdir -p " $base_dir "
96- cp -r sdd-package-base/. " $base_dir " /
88+
89+ # Copy base structure but filter scripts by variant
90+ SPEC_DIR=" $base_dir /.specify"
91+ mkdir -p " $SPEC_DIR "
92+
93+ [[ -d memory ]] && { cp -r memory " $SPEC_DIR /" ; echo " Copied memory -> .specify" ; }
94+
95+ # Only copy the relevant script variant directory
96+ if [[ -d scripts ]]; then
97+ mkdir -p " $SPEC_DIR /scripts"
98+ case $script in
99+ sh)
100+ [[ -d scripts/bash ]] && { cp -r scripts/bash " $SPEC_DIR /scripts/" ; echo " Copied scripts/bash -> .specify/scripts" ; }
101+ # Copy any script files that aren't in variant-specific directories
102+ find scripts -maxdepth 1 -type f -exec cp {} " $SPEC_DIR /scripts/" \; 2> /dev/null || true
103+ ;;
104+ ps)
105+ [[ -d scripts/powershell ]] && { cp -r scripts/powershell " $SPEC_DIR /scripts/" ; echo " Copied scripts/powershell -> .specify/scripts" ; }
106+ # Copy any script files that aren't in variant-specific directories
107+ find scripts -maxdepth 1 -type f -exec cp {} " $SPEC_DIR /scripts/" \; 2> /dev/null || true
108+ ;;
109+ esac
110+ fi
111+
112+ [[ -d templates ]] && { mkdir -p " $SPEC_DIR /templates" ; find templates -type f -not -path " templates/commands/*" -exec cp --parents {} " $SPEC_DIR " / \; ; echo " Copied templates -> .specify/templates" ; }
97113 # Inject variant into plan-template.md within .specify/templates if present
98114 local plan_tpl=" $base_dir /.specify/templates/plan-template.md"
99115 if [[ -f " $plan_tpl " ]]; then
0 commit comments