Skip to content

Commit 9c0a6dd

Browse files
committed
fix(offline): address Copilot review round 4
- fix(offline): use handle_vscode_settings() merge for --here --offline to prevent data loss on existing .vscode/settings.json - fix(release): glob wheel filename in create-github-release.sh instead of hardcoding version, preventing upload failures on version mismatch - docs(release): add comment noting pyproject.toml version is synced by release-trigger.yml before the tag is pushed
1 parent 7a70465 commit 9c0a6dd

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ jobs:
3838
chmod +x .github/workflows/scripts/create-release-packages.sh
3939
.github/workflows/scripts/create-release-packages.sh ${{ steps.version.outputs.tag }}
4040
41+
# Note: pyproject.toml version is already synced to the git tag by
42+
# release-trigger.yml (which updates pyproject.toml, commits, then pushes
43+
# the tag). No version sync step is needed here.
4144
- name: Build Python wheel
4245
if: steps.check_release.outputs.exists == 'false'
4346
run: |

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,26 @@ VERSION="$1"
1515
# Remove 'v' prefix from version for release title
1616
VERSION_NO_V=${VERSION#v}
1717

18+
# Find the built wheel dynamically to avoid version mismatch between
19+
# pyproject.toml and the git tag.
20+
shopt -s nullglob
21+
wheel_files=(.genreleases/specify_cli-*-py3-none-any.whl)
22+
23+
if (( ${#wheel_files[@]} == 0 )); then
24+
echo "Error: No specify_cli wheel found in .genreleases/" >&2
25+
exit 1
26+
fi
27+
28+
if (( ${#wheel_files[@]} > 1 )); then
29+
echo "Error: Multiple specify_cli wheels found in .genreleases/; expected exactly one:" >&2
30+
printf ' %s\n' "${wheel_files[@]}" >&2
31+
exit 1
32+
fi
33+
34+
WHEEL_FILE="${wheel_files[0]}"
35+
1836
gh release create "$VERSION" \
19-
.genreleases/specify_cli-"$VERSION_NO_V"-py3-none-any.whl \
37+
"$WHEEL_FILE" \
2038
.genreleases/spec-kit-template-copilot-sh-"$VERSION".zip \
2139
.genreleases/spec-kit-template-copilot-ps-"$VERSION".zip \
2240
.genreleases/spec-kit-template-claude-sh-"$VERSION".zip \

src/specify_cli/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,12 @@ def scaffold_from_core_pack(
12831283
rel = item.relative_to(build_dir)
12841284
dest = project_path / rel
12851285
dest.parent.mkdir(parents=True, exist_ok=True)
1286-
shutil.copy2(item, dest)
1286+
# When scaffolding into an existing directory (--here),
1287+
# use the same merge semantics as the GitHub-download path.
1288+
if is_current_dir and dest.name == "settings.json" and dest.parent.name == ".vscode":
1289+
handle_vscode_settings(item, dest, rel, verbose=False, tracker=tracker)
1290+
else:
1291+
shutil.copy2(item, dest)
12871292

12881293
if tracker:
12891294
tracker.complete("scaffold", "bundled assets applied")

0 commit comments

Comments
 (0)