mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-16 12:12:55 -06:00
fix: Adjust in create store files
This commit is contained in:
parent
2d816ab92d
commit
f42928f88f
@ -39,6 +39,7 @@ export class RepositoryBroker {
|
|||||||
this.logger.verbose('initializing repository without db');
|
this.logger.verbose('initializing repository without db');
|
||||||
if (!this.configService.get<Database>('DATABASE').ENABLED) {
|
if (!this.configService.get<Database>('DATABASE').ENABLED) {
|
||||||
const storePath = join(process.cwd(), 'store');
|
const storePath = join(process.cwd(), 'store');
|
||||||
|
|
||||||
this.logger.verbose('creating store path: ' + storePath);
|
this.logger.verbose('creating store path: ' + storePath);
|
||||||
try {
|
try {
|
||||||
const authDir = join(
|
const authDir = join(
|
||||||
@ -55,28 +56,35 @@ export class RepositoryBroker {
|
|||||||
|
|
||||||
// Check if directories exist, create them if not
|
// Check if directories exist, create them if not
|
||||||
if (!fs.existsSync(authDir)) {
|
if (!fs.existsSync(authDir)) {
|
||||||
|
this.logger.verbose('creating auth dir: ' + authDir);
|
||||||
fs.mkdirSync(authDir, { recursive: true });
|
fs.mkdirSync(authDir, { recursive: true });
|
||||||
}
|
}
|
||||||
if (!fs.existsSync(chatsDir)) {
|
if (!fs.existsSync(chatsDir)) {
|
||||||
|
this.logger.verbose('creating chats dir: ' + chatsDir);
|
||||||
fs.mkdirSync(chatsDir, { recursive: true });
|
fs.mkdirSync(chatsDir, { recursive: true });
|
||||||
}
|
}
|
||||||
if (!fs.existsSync(contactsDir)) {
|
if (!fs.existsSync(contactsDir)) {
|
||||||
|
this.logger.verbose('creating contacts dir: ' + contactsDir);
|
||||||
fs.mkdirSync(contactsDir, { recursive: true });
|
fs.mkdirSync(contactsDir, { recursive: true });
|
||||||
}
|
}
|
||||||
if (!fs.existsSync(messagesDir)) {
|
if (!fs.existsSync(messagesDir)) {
|
||||||
|
this.logger.verbose('creating messages dir: ' + messagesDir);
|
||||||
fs.mkdirSync(messagesDir, { recursive: true });
|
fs.mkdirSync(messagesDir, { recursive: true });
|
||||||
}
|
}
|
||||||
if (!fs.existsSync(messageUpDir)) {
|
if (!fs.existsSync(messageUpDir)) {
|
||||||
|
this.logger.verbose('creating message-up dir: ' + messageUpDir);
|
||||||
fs.mkdirSync(messageUpDir, { recursive: true });
|
fs.mkdirSync(messageUpDir, { recursive: true });
|
||||||
}
|
}
|
||||||
if (!fs.existsSync(webhookDir)) {
|
if (!fs.existsSync(webhookDir)) {
|
||||||
|
this.logger.verbose('creating webhook dir: ' + webhookDir);
|
||||||
fs.mkdirSync(webhookDir, { recursive: true });
|
fs.mkdirSync(webhookDir, { recursive: true });
|
||||||
}
|
}
|
||||||
if (!fs.existsSync(chatwootDir)) {
|
if (!fs.existsSync(chatwootDir)) {
|
||||||
|
this.logger.verbose('creating chatwoot dir: ' + chatwootDir);
|
||||||
fs.mkdirSync(chatwootDir, { recursive: true });
|
fs.mkdirSync(chatwootDir, { recursive: true });
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
this.logger.error(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user