mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 20:00:42 +00:00
fix: skip symlink recursion in runtime dep fingerprints
This commit is contained in:
@@ -247,16 +247,20 @@ function appendDirectoryFingerprint(hash, rootDir, currentDir = rootDir) {
|
||||
|
||||
for (const entry of entries) {
|
||||
const fullPath = path.join(currentDir, entry.name);
|
||||
const stat = fs.statSync(fullPath);
|
||||
const relativePath = path.relative(rootDir, fullPath).replace(/\\/g, "/");
|
||||
if (stat.isDirectory()) {
|
||||
if (entry.isSymbolicLink()) {
|
||||
hash.update(`symlink:${relativePath}->${fs.readlinkSync(fullPath).replace(/\\/g, "/")}\n`);
|
||||
continue;
|
||||
}
|
||||
if (entry.isDirectory()) {
|
||||
hash.update(`dir:${relativePath}\n`);
|
||||
appendDirectoryFingerprint(hash, rootDir, fullPath);
|
||||
continue;
|
||||
}
|
||||
if (!stat.isFile()) {
|
||||
if (!entry.isFile()) {
|
||||
continue;
|
||||
}
|
||||
const stat = fs.statSync(fullPath);
|
||||
hash.update(`file:${relativePath}:${stat.size}\n`);
|
||||
hash.update(fs.readFileSync(fullPath));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user