this is the code that imports the files:
/**
* Dynamically import all files matching the glob pattern
* @param globPath - The glob pattern to match files
*/
export async function importer(globPath: string) {
if (Deno.args.includes('--is_compiled_binary')) {
// Import the manifest file and import all files listed in it
const { default: manifest } = await import(import.meta.resolve('../../../manifest.json'));
for (const module of manifest.modules) {
for await (const commandFiles of Deno.readDir(${join(import.meta.dirname!, '../../../')}${module}/commands)) {
await import(import.meta.resolve(`file:///${join(import.meta.dirname!, '../../../')}${module}\\commands\\${commandFiles.name}\));
}
}
}
}
this is the code that imports the files:
/**
* Dynamically import all files matching the glob pattern
* @param globPath - The glob pattern to match files
*/
export async function importer(globPath: string) {
if (Deno.args.includes('--is_compiled_binary')) {
// Import the manifest file and import all files listed in it
const { default: manifest } = await import(import.meta.resolve('../../../manifest.json'));
for (const module of manifest.modules) {
for await (const commandFiles of Deno.readDir(${join(import.meta.dirname!, '../../../')}${module}/commands)) {
await import(import.meta.resolve(`file:///${join(import.meta.dirname!, '../../../')}${module}\\commands\\${commandFiles.name}\));
}
}
}
}