`run-vitest-coverage.mjs` reused `process.env.npm_execpath` with `process.execPath` (node) for a fast path that skips the pnpm wrapper. That assumes `npm_execpath` is a JS file, but standalone pnpm installs ship a native Mach-O / ELF binary, so node tries to load the binary as a CJS module and crashes with `SyntaxError: Invalid or unexpected token`, taking the pre-push hook down with it. Only take the fast path when the path actually looks like a JS module (`.js`/`.mjs`/`.cjs`); otherwise fall back to invoking `pnpm` from PATH, which is what the script already does when `npm_execpath` is unset.
4.8 KiB
4.8 KiB