Skip to content

Commit

Permalink
isDirectorySync
Browse files Browse the repository at this point in the history
  • Loading branch information
chatbookai committed Jun 2, 2024
1 parent 924fb48 commit e5f18b9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions express/src/utils/db.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions express/src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ function copyFileSync2(source, target) {
fs.writeFileSync(targetFile, fs.readFileSync(source));
}

export function isDirectorySync(filePath) {
try {
const stats = fs.statSync(filePath);
return stats.isDirectory();
} catch (error) {
console.error(`Error checking if directory: ${error.message}`);
return false;
}
}

export async function getLLMSSetting(datasetId) {
const { DataDir, db, getDbRecord, getDbRecordALL } = ChatBookDbPool()

Expand Down

0 comments on commit e5f18b9

Please sign in to comment.