mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 17:00:50 +00:00
refactor: dedupe tooling helpers
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { spawnSync } from "node:child_process";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { readFlagValue } from "./arg-utils.mjs";
|
||||
|
||||
const CORE_TEST_CONFIGS = new Set([
|
||||
"tsconfig.core.test.json",
|
||||
@@ -73,16 +74,3 @@ function isMetadataOnlyCommand(args) {
|
||||
["--help", "-h", "--version", "-v", "--init", "--showConfig"].includes(arg),
|
||||
);
|
||||
}
|
||||
|
||||
function readFlagValue(args, name) {
|
||||
for (let index = 0; index < args.length; index++) {
|
||||
const arg = args[index];
|
||||
if (arg === name) {
|
||||
return args[index + 1];
|
||||
}
|
||||
if (arg.startsWith(`${name}=`)) {
|
||||
return arg.slice(name.length + 1);
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user