mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 09:02:08 +00:00
parent
1675824ed3
commit
5555864c57
1 changed files with 8 additions and 0 deletions
|
|
@ -552,6 +552,14 @@ function loadThemeJson(name: string): ThemeJson {
|
||||||
if (name in builtinThemes) {
|
if (name in builtinThemes) {
|
||||||
return builtinThemes[name];
|
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 customThemesDir = getCustomThemesDir();
|
||||||
const themePath = path.join(customThemesDir, `${name}.json`);
|
const themePath = path.join(customThemesDir, `${name}.json`);
|
||||||
if (!fs.existsSync(themePath)) {
|
if (!fs.existsSync(themePath)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue