@@ -6,17 +6,29 @@ set -euo pipefail
66
77SERVICE=" ${1:- release} "
88
9- # Read expected version from package.json, with fallback
9+ # Determine the expected installed version
10+ # The build process (set-version.py) only updates package.json for exact semver versions (X.Y.Z).
11+ # For non-release versions (e.g., 1.31.7-7-gabcdef), it leaves package.json at 99.0.0.
12+ # We need to match this logic to know what version the extension will actually install as.
1013SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
11- PACKAGE_JSON =" $SCRIPT_DIR /../../extensions/vscode/package.json "
14+ REPO_ROOT =" $SCRIPT_DIR /../.."
1215
13- if [ -f " $PACKAGE_JSON " ]; then
14- EXPECTED_VERSION=$( grep -o ' "version": *"[^"]*"' " $PACKAGE_JSON " | cut -d' "' -f4)
16+ # Get the git-derived version (same as build process)
17+ GIT_VERSION=$( cd " $REPO_ROOT " && git describe --tags 2> /dev/null | sed ' s/^v//' )
18+
19+ if [ -z " $GIT_VERSION " ]; then
20+ echo " Warning: Could not determine version from git tags, falling back to 99.0.0"
21+ EXPECTED_VERSION=" 99.0.0"
22+ elif [[ " $GIT_VERSION " =~ ^[0-9]+\. [0-9]+\. [0-9]+$ ]]; then
23+ # Exact semver version (e.g., 1.32.0) - set-version.py will update package.json
24+ EXPECTED_VERSION=" $GIT_VERSION "
1525else
16- echo " Warning: package.json not found at $PACKAGE_JSON , falling back to hardcoded version "
26+ # Non-release version (e.g., 1.31.7-7-gabcdef) - set-version.py skips, stays at 99.0.0
1727 EXPECTED_VERSION=" 99.0.0"
1828fi
1929
30+ echo " Git version: $GIT_VERSION , Expected installed version: $EXPECTED_VERSION "
31+
2032echo " Installing Publisher extension in Workbench $SERVICE container..."
2133
2234# Check if container is running
0 commit comments