From f6e2ad07ece629965f45ee312bd96c0b40e405df Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 10 May 2026 02:13:55 +0100 Subject: [PATCH] ci(release): normalize Windows loader npm paths --- .../github/run-openclaw-cross-os-release-checks.sh | 12 +++++++++--- .../openclaw-cross-os-release-workflow.test.ts | 3 +++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/github/run-openclaw-cross-os-release-checks.sh b/scripts/github/run-openclaw-cross-os-release-checks.sh index 3be9081b2db..b8a3e3541a4 100755 --- a/scripts/github/run-openclaw-cross-os-release-checks.sh +++ b/scripts/github/run-openclaw-cross-os-release-checks.sh @@ -42,8 +42,14 @@ fi tool_dir="${OPENCLAW_RELEASE_TSX_TOOL_DIR:-${temp_root}/openclaw-release-tsx-${tsx_version}}" loader_path="${tool_dir}/node_modules/tsx/dist/loader.mjs" npm_tool_dir="${tool_dir}" +npm_cli_arg="${npm_cli_js}" +loader_arg="${loader_path}" if command -v cygpath >/dev/null 2>&1; then npm_tool_dir="$(cygpath -w "${tool_dir}")" + if [[ -n "${npm_cli_js}" ]]; then + npm_cli_arg="$(cygpath -w "${npm_cli_js}")" + fi + loader_arg="$(cygpath -w "${loader_path}")" fi command -v "${node_cmd}" >/dev/null 2>&1 || { @@ -58,8 +64,8 @@ command -v "${npm_cmd}" >/dev/null 2>&1 || { if [[ ! -f "${loader_path}" ]]; then mkdir -p "${tool_dir}" if [[ -n "${npm_cli_js}" ]]; then - if ! "${node_cmd}" "${npm_cli_js}" install --prefix "${tool_dir}" --no-save --no-package-lock "tsx@${tsx_version}" >/dev/null; then - echo "failed to install cross-OS release-check loader with ${node_cmd} ${npm_cli_js}." >&2 + if ! "${node_cmd}" "${npm_cli_arg}" install --prefix "${npm_tool_dir}" --no-save --no-package-lock "tsx@${tsx_version}" >/dev/null; then + echo "failed to install cross-OS release-check loader with ${node_cmd} ${npm_cli_arg}." >&2 exit 127 fi elif ! "${npm_cmd}" install --prefix "${npm_tool_dir}" --no-save --no-package-lock "tsx@${tsx_version}" >/dev/null; then @@ -79,7 +85,7 @@ loader_url="$( const { resolve } = require("node:path"); const { pathToFileURL } = require("node:url"); process.stdout.write(pathToFileURL(resolve(process.argv[1])).href); - ' "${loader_path}" + ' "${loader_arg}" )" exec "${node_cmd}" --import "${loader_url}" "${script_path}" "$@" diff --git a/test/scripts/openclaw-cross-os-release-workflow.test.ts b/test/scripts/openclaw-cross-os-release-workflow.test.ts index 8d64e1e109c..0f8f196ba64 100644 --- a/test/scripts/openclaw-cross-os-release-workflow.test.ts +++ b/test/scripts/openclaw-cross-os-release-workflow.test.ts @@ -20,6 +20,9 @@ describe("cross-OS release checks workflow", () => { expect(wrapper).toContain("command -v npm.cmd"); expect(wrapper).toContain('npm_tool_dir="$(cygpath -w "${tool_dir}")"'); + expect(wrapper).toContain('npm_cli_arg="$(cygpath -w "${npm_cli_js}")"'); + expect(wrapper).toContain('loader_arg="$(cygpath -w "${loader_path}")"'); + expect(wrapper).toContain('"${node_cmd}" "${npm_cli_arg}" install --prefix "${npm_tool_dir}"'); expect(wrapper).toContain('"${npm_cmd}" install --prefix "${npm_tool_dir}"'); expect(wrapper).toContain('exec "${node_cmd}" --import "${loader_url}"'); });