Skip to content

Commit 7136517

Browse files
authored
fix: publish windows npm package correctly (#83)
NPM always uses win32 (also for x64 and ARM) as the windows platform name
1 parent c913992 commit 7136517

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

npm/publish/create-platform-packages.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ declare -A platforms=(
2525
["x86_64-apple-darwin"]="darwin x64 "
2626
["x86_64-unknown-linux-gnu"]="linux x64 "
2727
["aarch64-unknown-linux-gnu"]="linux arm64 "
28-
["x86_64-pc-windows-msvc"]="windows x64 .exe"
29-
["aarch64-pc-windows-msvc"]="windows arm64 .exe"
28+
["x86_64-pc-windows-msvc"]="win32 x64 .exe"
29+
["aarch64-pc-windows-msvc"]="win32 arm64 .exe"
3030
)
3131

3232
for target in "${!platforms[@]}"; do
3333
read os arch ext <<< "${platforms[$target]}"
3434

3535
# Determine archive extension
36-
if [[ "$os" == "windows" ]]; then
36+
if [[ "$os" == "win32" ]]; then
3737
archive_ext="zip"
3838
else
3939
archive_ext="tar.gz"
@@ -77,7 +77,7 @@ for target in "${!platforms[@]}"; do
7777
envsubst < "$TEMPLATE_PATH" > "${pkg_dir}/package.json"
7878

7979
# Update bin field for Windows to include .exe extension
80-
if [[ "$os" == "windows" ]]; then
80+
if [[ "$os" == "win32" ]]; then
8181
# Use sed to update the bin path in package.json
8282
sed -i.bak 's|"bin/codex-acp"|"bin/codex-acp.exe"|' "${pkg_dir}/package.json"
8383
rm "${pkg_dir}/package.json.bak"

0 commit comments

Comments
 (0)