mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 14:58:26 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -14,8 +14,12 @@ const TAR_SUFFIXES = [".tgz", ".tar.gz", ".tar"];
|
||||
|
||||
export function resolveArchiveKind(filePath: string): ArchiveKind | null {
|
||||
const lower = filePath.toLowerCase();
|
||||
if (lower.endsWith(".zip")) return "zip";
|
||||
if (TAR_SUFFIXES.some((suffix) => lower.endsWith(suffix))) return "tar";
|
||||
if (lower.endsWith(".zip")) {
|
||||
return "zip";
|
||||
}
|
||||
if (TAR_SUFFIXES.some((suffix) => lower.endsWith(suffix))) {
|
||||
return "tar";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -23,7 +27,9 @@ export async function resolvePackedRootDir(extractDir: string): Promise<string>
|
||||
const direct = path.join(extractDir, "package");
|
||||
try {
|
||||
const stat = await fs.stat(direct);
|
||||
if (stat.isDirectory()) return direct;
|
||||
if (stat.isDirectory()) {
|
||||
return direct;
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
@@ -57,7 +63,9 @@ export async function withTimeout<T>(
|
||||
}),
|
||||
]);
|
||||
} finally {
|
||||
if (timeoutId) clearTimeout(timeoutId);
|
||||
if (timeoutId) {
|
||||
clearTimeout(timeoutId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user