fix(cli): accept node24 executable names in argv reparse

This commit is contained in:
Peter Steinberger
2026-02-26 22:34:42 +01:00
parent d33db186d0
commit ca2ae342db
2 changed files with 13 additions and 1 deletions

View File

@@ -204,6 +204,18 @@ describe("argv helpers", () => {
rawArgs: ["/usr/bin/node-22.2.0", "openclaw", "status"],
expected: ["/usr/bin/node-22.2.0", "openclaw", "status"],
},
{
rawArgs: ["node24", "openclaw", "status"],
expected: ["node24", "openclaw", "status"],
},
{
rawArgs: ["/usr/bin/node24", "openclaw", "status"],
expected: ["/usr/bin/node24", "openclaw", "status"],
},
{
rawArgs: ["node24.exe", "openclaw", "status"],
expected: ["node24.exe", "openclaw", "status"],
},
{
rawArgs: ["nodejs", "openclaw", "status"],
expected: ["nodejs", "openclaw", "status"],

View File

@@ -172,7 +172,7 @@ export function buildParseArgv(params: {
return ["node", programName || "openclaw", ...normalizedArgv];
}
const nodeExecutablePattern = /^node-\d+(?:\.\d+)*(?:\.exe)?$/;
const nodeExecutablePattern = /^node(?:-\d+|\d+)(?:\.\d+)*(?:\.exe)?$/;
function isNodeExecutable(executable: string): boolean {
return (