forked from noxious/server
Storage class is now OOP
This commit is contained in:
@ -3,7 +3,7 @@ import * as path from 'path'
|
||||
import { pathToFileURL } from 'url'
|
||||
|
||||
import Logger, { LoggerType } from '#application/logger'
|
||||
import { getAppPath } from '#application/storage'
|
||||
import Storage from '#application/storage'
|
||||
import { Command } from '#application/types'
|
||||
|
||||
export class CommandRegistry {
|
||||
@ -15,7 +15,7 @@ export class CommandRegistry {
|
||||
}
|
||||
|
||||
public async loadCommands(): Promise<void> {
|
||||
const directory = getAppPath('commands')
|
||||
const directory = Storage.getAppPath('commands')
|
||||
this.logger.info(`Loading commands from: ${directory}`)
|
||||
|
||||
try {
|
||||
@ -32,7 +32,7 @@ export class CommandRegistry {
|
||||
|
||||
private async loadCommandFile(file: fs.Dirent): Promise<void> {
|
||||
try {
|
||||
const filePath = getAppPath('commands', file.name)
|
||||
const filePath = Storage.getAppPath('commands', file.name)
|
||||
const commandName = path.basename(file.name, path.extname(file.name))
|
||||
|
||||
const module = await import(pathToFileURL(filePath).href)
|
||||
|
Reference in New Issue
Block a user