Skip to content

Commit

Permalink
fix: 可能出现的没有文件或文件夹
Browse files Browse the repository at this point in the history
  • Loading branch information
XasYer committed Dec 16, 2024
1 parent af28ffe commit 74e843b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"author": "XasYer",
"type": "module",
"scripts": {
"start": "node dist/index.js",
"start": "node lib/index.js",
"dev": "tsx src/index.ts",
"build": "tsc && tsc-alias",
"clean": "rm -rf dist"
"clean": "rm -rf lib"
},
"dependencies": {
"@fastify/auth": "^5.0.1",
Expand Down
7 changes: 6 additions & 1 deletion src/api/database/sqlite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ function findSqlitePath (directory: string): string[] {
continue
}
const fullPath = join(directory, item)
const stat = fs.statSync(fullPath)
let stat: fs.Stats | undefined
try {
stat = fs.statSync(fullPath)
} catch {
continue
}

if (stat.isDirectory()) {
dbPath.push(...findSqlitePath(fullPath))
Expand Down

0 comments on commit 74e843b

Please sign in to comment.