Files
CDN-APP-INSIDER/models/fileCreated.js
Dinawo 7a02f2682c
All checks were successful
continuous-integration/drone/push Build is passing
Add new dependencies and update file paths
2024-04-17 01:42:24 +02:00

16 lines
580 B
JavaScript

const fs = require('fs');
const path = require('path');
const { logger, ErrorLogger, logRequestInfo } = require('../config/logs');
const dataFolderPath = path.join(__dirname, '../data');
const filesToCreate = ['setup.json', 'user.json', 'file_info.json', 'banData.json'];
filesToCreate.forEach((fileName) => {
const filePath = path.join(dataFolderPath, fileName);
if (!fs.existsSync(filePath)) {
fs.writeFileSync(filePath, '[]');
logger.info(`${fileName} created successfully.`);
} else {
logger.info(`${fileName} already exists.`);
}
});