fix(cli): accept node24 executable names in argv reparse
This commit is contained in:
parent
d33db186d0
commit
ca2ae342db
@ -204,6 +204,18 @@ describe("argv helpers", () => {
|
|||||||
rawArgs: ["/usr/bin/node-22.2.0", "openclaw", "status"],
|
rawArgs: ["/usr/bin/node-22.2.0", "openclaw", "status"],
|
||||||
expected: ["/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"],
|
rawArgs: ["nodejs", "openclaw", "status"],
|
||||||
expected: ["nodejs", "openclaw", "status"],
|
expected: ["nodejs", "openclaw", "status"],
|
||||||
|
|||||||
@ -172,7 +172,7 @@ export function buildParseArgv(params: {
|
|||||||
return ["node", programName || "openclaw", ...normalizedArgv];
|
return ["node", programName || "openclaw", ...normalizedArgv];
|
||||||
}
|
}
|
||||||
|
|
||||||
const nodeExecutablePattern = /^node-\d+(?:\.\d+)*(?:\.exe)?$/;
|
const nodeExecutablePattern = /^node(?:-\d+|\d+)(?:\.\d+)*(?:\.exe)?$/;
|
||||||
|
|
||||||
function isNodeExecutable(executable: string): boolean {
|
function isNodeExecutable(executable: string): boolean {
|
||||||
return (
|
return (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user