File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ) ;
Original file line number Diff line number Diff line change 11// Openshell plugin module implements mirror behavior.
22import fs from "node:fs/promises" ;
33import path from "node:path" ;
4- import { movePathWithCopyFallback } from "openclaw/plugin-sdk/security-runtime" ;
4+ import { extractErrorCode , movePathWithCopyFallback } from "openclaw/plugin-sdk/security-runtime" ;
55import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime" ;
66import pLimit from "p-limit" ;
77
@@ -16,8 +16,8 @@ function createExcludeMatcher(excludeDirs?: readonly string[]) {
1616const runLimitedFs = pLimit ( COPY_TREE_FS_CONCURRENCY ) ;
1717
1818async 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 ;
You can’t perform that action at this time.
0 commit comments