Fixes distributed themes breaking /export (#946)

Thanks
This commit is contained in:
Armin Ronacher 2026-01-25 19:26:54 +01:00 committed by GitHub
parent 1675824ed3
commit 5555864c57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -552,6 +552,14 @@ function loadThemeJson(name: string): ThemeJson {
if (name in builtinThemes) {
return builtinThemes[name];
}
const registeredTheme = registeredThemes.get(name);
if (registeredTheme?.sourcePath) {
const content = fs.readFileSync(registeredTheme.sourcePath, "utf-8");
return parseThemeJsonContent(registeredTheme.sourcePath, content);
}
if (registeredTheme) {
throw new Error(`Theme "${name}" does not have a source path for export`);
}
const customThemesDir = getCustomThemesDir();
const themePath = path.join(customThemesDir, `${name}.json`);
if (!fs.existsSync(themePath)) {