diff --git a/src/application/console/commandRegistry.ts b/src/application/console/commandRegistry.ts index 54e3f04..b5d99a4 100644 --- a/src/application/console/commandRegistry.ts +++ b/src/application/console/commandRegistry.ts @@ -1,5 +1,6 @@ import * as fs from 'fs' import * as path from 'path' + import Logger, { LoggerType } from '#application/logger' import { getAppPath } from '#application/storage' import { Command } from '#application/types' @@ -18,11 +19,7 @@ export class CommandRegistry { try { const files = await fs.promises.readdir(directory, { withFileTypes: true }) - await Promise.all( - files - .filter(file => this.isValidCommandFile(file)) - .map(file => this.loadCommandFile(file)) - ) + await Promise.all(files.filter((file) => this.isValidCommandFile(file)).map((file) => this.loadCommandFile(file))) } catch (error) { this.logger.error(`Failed to read commands directory: ${error instanceof Error ? error.message : String(error)}`) } @@ -56,4 +53,4 @@ export class CommandRegistry { this.commands.set(name, CommandClass) this.logger.info(`Registered command: ${name}`) } -} \ No newline at end of file +} diff --git a/src/application/console/consolePrompt.ts b/src/application/console/consolePrompt.ts index 129b20c..41aaa74 100644 --- a/src/application/console/consolePrompt.ts +++ b/src/application/console/consolePrompt.ts @@ -30,4 +30,4 @@ export class ConsolePrompt { this.promptCommand() }) } -} \ No newline at end of file +} diff --git a/src/application/console/logReader.ts b/src/application/console/logReader.ts index e48b23b..6385bc2 100644 --- a/src/application/console/logReader.ts +++ b/src/application/console/logReader.ts @@ -1,5 +1,6 @@ import * as fs from 'fs' import * as path from 'path' + import Logger, { LoggerType } from '#application/logger' export class LogReader { @@ -17,7 +18,7 @@ export class LogReader { } public stop(): void { - this.watchers.forEach(watcher => watcher.close()) + this.watchers.forEach((watcher) => watcher.close()) this.watchers = [] } @@ -33,8 +34,8 @@ export class LogReader { // Watch existing files try { fs.readdirSync(this.logsDirectory) - .filter(file => file.endsWith('.log')) - .forEach(file => this.watchLogFile(file)) + .filter((file) => file.endsWith('.log')) + .forEach((file) => this.watchLogFile(file)) } catch (error) { this.logger.error(`Error reading logs directory: ${error}`) } @@ -73,4 +74,4 @@ export class LogReader { this.watchers.push(watcher) } -} \ No newline at end of file +} diff --git a/src/managers/consoleManager.ts b/src/managers/consoleManager.ts index 4d908e5..e2b48d5 100644 --- a/src/managers/consoleManager.ts +++ b/src/managers/consoleManager.ts @@ -1,4 +1,5 @@ import { Server } from 'socket.io' + import { CommandRegistry } from '#application/console/commandRegistry' import { ConsolePrompt } from '#application/console/consolePrompt' import { LogReader } from '#application/console/logReader' @@ -13,9 +14,7 @@ export class ConsoleManager { constructor() { this.registry = new CommandRegistry() - this.prompt = new ConsolePrompt( - (command: string) => this.processCommand(command) - ) + this.prompt = new ConsolePrompt((command: string) => this.processCommand(command)) this.logReader = new LogReader(process.cwd()) } @@ -53,4 +52,4 @@ export class ConsoleManager { } } -export default new ConsoleManager() \ No newline at end of file +export default new ConsoleManager()