Skip to content

Commit ca2ae34

Browse files
committed
fix(cli): accept node24 executable names in argv reparse
1 parent d33db18 commit ca2ae34

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/cli/argv.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,18 @@ describe("argv helpers", () => {
204204
rawArgs: ["/usr/bin/node-22.2.0", "openclaw", "status"],
205205
expected: ["/usr/bin/node-22.2.0", "openclaw", "status"],
206206
},
207+
{
208+
rawArgs: ["node24", "openclaw", "status"],
209+
expected: ["node24", "openclaw", "status"],
210+
},
211+
{
212+
rawArgs: ["/usr/bin/node24", "openclaw", "status"],
213+
expected: ["/usr/bin/node24", "openclaw", "status"],
214+
},
215+
{
216+
rawArgs: ["node24.exe", "openclaw", "status"],
217+
expected: ["node24.exe", "openclaw", "status"],
218+
},
207219
{
208220
rawArgs: ["nodejs", "openclaw", "status"],
209221
expected: ["nodejs", "openclaw", "status"],

src/cli/argv.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export function buildParseArgv(params: {
172172
return ["node", programName || "openclaw", ...normalizedArgv];
173173
}
174174

175-
const nodeExecutablePattern = /^node-\d+(?:\.\d+)*(?:\.exe)?$/;
175+
const nodeExecutablePattern = /^node(?:-\d+|\d+)(?:\.\d+)*(?:\.exe)?$/;
176176

177177
function isNodeExecutable(executable: string): boolean {
178178
return (

0 commit comments

Comments
 (0)