mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 13:20:43 +00:00
refactor: hide local check helpers
This commit is contained in:
@@ -20,7 +20,7 @@ export function isLocalCheckEnabled(env) {
|
||||
return raw !== "0" && raw !== "false";
|
||||
}
|
||||
|
||||
export function isCiLikeEnv(env = process.env) {
|
||||
function isCiLikeEnv(env = process.env) {
|
||||
return env.CI === "true" || env.GITHUB_ACTIONS === "true";
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ export function resolveLocalHeavyCheckEnv(env = process.env) {
|
||||
};
|
||||
}
|
||||
|
||||
export function hasFlag(args, name) {
|
||||
function hasFlag(args, name) {
|
||||
return args.some((arg) => arg === name || arg.startsWith(`${name}=`));
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ export function shouldAcquireLocalHeavyCheckLockForTsgo(args, env = process.env)
|
||||
);
|
||||
}
|
||||
|
||||
export function shouldThrottleLocalHeavyChecks(env, hostResources, defaultMode = "throttled") {
|
||||
function shouldThrottleLocalHeavyChecks(env, hostResources, defaultMode = "throttled") {
|
||||
if (!isLocalCheckEnabled(env)) {
|
||||
return false;
|
||||
}
|
||||
@@ -273,7 +273,7 @@ export function acquireLocalHeavyCheckLockSync(params) {
|
||||
}
|
||||
}
|
||||
|
||||
export function resolveGitCommonDir(cwd) {
|
||||
function resolveGitCommonDir(cwd) {
|
||||
const result = spawnSync("git", ["rev-parse", "--git-common-dir"], {
|
||||
cwd,
|
||||
encoding: "utf8",
|
||||
|
||||
Reference in New Issue
Block a user