mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-01 04:40:38 +08:00
修复脚本和日志列表获取软链接循环失败
This commit is contained in:
+3
-3
@@ -30,7 +30,7 @@ export async function getLastModifyFilePath(dir: string) {
|
||||
|
||||
arr.forEach(async (item) => {
|
||||
const fullpath = path.join(dir, item);
|
||||
const stats = await fs.stat(fullpath);
|
||||
const stats = await fs.lstat(fullpath);
|
||||
if (stats.isFile()) {
|
||||
if (stats.mtimeMs >= 0) {
|
||||
filePath = fullpath;
|
||||
@@ -257,7 +257,7 @@ export async function readDirs(
|
||||
|
||||
for (const file of files) {
|
||||
const subPath = path.join(dir, file);
|
||||
const stats = await fs.stat(subPath);
|
||||
const stats = await fs.lstat(subPath);
|
||||
const key = path.join(relativePath, file);
|
||||
|
||||
if (blacklist.includes(file) || stats.isSymbolicLink()) {
|
||||
@@ -300,7 +300,7 @@ export async function readDir(
|
||||
.filter((x) => !blacklist.includes(x))
|
||||
.map(async (file: string) => {
|
||||
const subPath = path.join(dir, file);
|
||||
const stats = await fs.stat(subPath);
|
||||
const stats = await fs.lstat(subPath);
|
||||
const key = path.join(relativePath, file);
|
||||
return {
|
||||
title: file,
|
||||
|
||||
Reference in New Issue
Block a user