mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Fix email template loading (#21718)
* ugly exception for templates * Ignore folders that aren't valid extensions * Add changeset * Don't double-loop * Super small polishing --------- Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com> Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
This commit is contained in:
5
.changeset/tough-pigs-beg.md
Normal file
5
.changeset/tough-pigs-beg.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@directus/extensions': patch
|
||||
---
|
||||
|
||||
Fixed an issue that would cause extensions loading to fail when non-extension folders were included in the extensions folder
|
||||
@@ -80,14 +80,19 @@ export async function resolveFsExtensions(root: string): Promise<Map<string, Ext
|
||||
const manifest: Record<string, any> = await fse.readJSON(join(path, 'package.json'));
|
||||
return { name: folder, path, manifest };
|
||||
} catch {
|
||||
throw new Error(`Extension "${folder}" (${path}) does not contain a package.json file.`);
|
||||
// Ignore invalid extensions or non-extension folders
|
||||
return;
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
const extensions = new Map();
|
||||
|
||||
for (const { name, path, manifest } of extensionMap.values()) {
|
||||
for (const extension of extensionMap.values()) {
|
||||
if (!extension) continue;
|
||||
|
||||
const { name, path, manifest } = extension;
|
||||
|
||||
let parsedManifest;
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user