Skip to content

Commit b2e35d4

Browse files
committed
chore(openshell): satisfy mirror callback lint rules
1 parent 5f8a60c commit b2e35d4

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎extensions/openshell/src/mirror.test.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ describe("replaceDirectoryContents", () => {
106106
);
107107
try {
108108
await Promise.all([failedCopyStarted.promise, delayedCopyStarted.promise]);
109-
await new Promise<void>((resolve) => setImmediate(resolve));
109+
await new Promise<void>((resolve) => {
110+
setImmediate(resolve);
111+
});
110112
expect(settled).toBe(false);
111113
releaseCopy.resolve();
112114
expect(await replacement).toBe(failure);

‎extensions/openshell/src/mirror.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Openshell plugin module implements mirror behavior.
22
import fs from "node:fs/promises";
33
import path from "node:path";
4-
import { movePathWithCopyFallback } from "openclaw/plugin-sdk/security-runtime";
4+
import { extractErrorCode, movePathWithCopyFallback } from "openclaw/plugin-sdk/security-runtime";
55
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
66
import pLimit from "p-limit";
77

@@ -16,8 +16,8 @@ function createExcludeMatcher(excludeDirs?: readonly string[]) {
1616
const runLimitedFs = pLimit(COPY_TREE_FS_CONCURRENCY);
1717

1818
async function lstatIfExists(targetPath: string) {
19-
return await runLimitedFs(fs.lstat, targetPath).catch((error: NodeJS.ErrnoException) => {
20-
if (error.code === "ENOENT") {
19+
return await runLimitedFs(fs.lstat, targetPath).catch((error: unknown) => {
20+
if (extractErrorCode(error) === "ENOENT") {
2121
return null;
2222
}
2323
throw error;

0 commit comments

Comments
 (0)