Skip to content

Commit 8f9cff5

Browse files
shmuelieCopilot
andcommitted
msix: convert version to valid MSIX format (X.X.X.X)
MSIX packages require versions in strict X.X.X.X numeric format. Convert Git for Windows versions (e.g. '2.47.1.windows.1' -> '2.47.1.1') and handle test versions (e.g. '0-test' -> '0.0.0.0') by stripping non-numeric characters and padding with .0 segments as needed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Shmueli Englard <senglard@microsoft.com>
1 parent a9d7ebf commit 8f9cff5

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

msix/release.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,17 @@ esac
6666
MSYSTEM_LOWER=${MSYSTEM,,}
6767
VERSION=$1
6868
shift
69+
70+
# MSIX requires version in X.X.X.X format (numeric only)
71+
# Convert Git for Windows versions like "2.47.1.windows.1" to "2.47.1.1"
72+
# and test versions like "0-test" to "0.0.0.0"
73+
MSIX_VERSION="$(echo "$VERSION" | sed -e 's/\.windows\./\./' -e 's/[^0-9.]//g')"
74+
# Ensure we have exactly 4 numeric segments
75+
while test "$(echo "$MSIX_VERSION" | tr -cd '.' | wc -c)" -lt 3
76+
do
77+
MSIX_VERSION="$MSIX_VERSION.0"
78+
done
79+
6980
TARGET="$output_directory"/Git.GitforWindows_"$VERSION"_"$ARTIFACT_SUFFIX".msix
7081
SCRIPT_PATH="$(cd "$(dirname "$0")" && pwd)"
7182

@@ -176,7 +187,7 @@ MANIFESTOUT=$SCRIPT_PATH/root/appxmanifest.xml
176187

177188
echo "Create MSIX"
178189

179-
sed -e "s/@@VERSION@@/$VERSION/g" <"$MANIFESTIN" >"$MANIFESTOUT"
190+
sed -e "s/@@VERSION@@/$MSIX_VERSION/g" <"$MANIFESTIN" >"$MANIFESTOUT"
180191

181192
echo "[Files]" >"$MAPFILE" &&
182193
echo "\"$(cygpath -aw "$SCRIPT_PATH")/root/appxmanifest.xml\" \"AppxManifest.xml\"" >>"$MAPFILE" &&

0 commit comments

Comments
 (0)