Skip to content

Commit

Permalink
docs(export): specify output name
Browse files Browse the repository at this point in the history
  • Loading branch information
JanDeDobbeleer committed Jul 11, 2024
1 parent fb9d447 commit cf8c71c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions website/export_themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,18 @@ themeConfigOverrrides.set('catppuccin_mocha.omp.json', newThemeConfig('IrwinJuic
if (!isValidTheme(theme)) {
continue;
}

const configPath = path.join(themesConfigDir, theme);

let config = newThemeConfig();
if (themeConfigOverrrides.has(theme)) {
config = themeConfigOverrrides.get(theme);
}

let poshCommand = `oh-my-posh config export image --config=${configPath}`;
const themeName = theme.slice(0, -9);
const image = themeName + '.png';

let poshCommand = `oh-my-posh config export image --config=${configPath} --output=${image}`;
poshCommand += ` --background-color=${config.bgColor}`;
if (config.author !== '') {
poshCommand += ` --author="${config.author}"`;
Expand All @@ -62,10 +66,8 @@ themeConfigOverrrides.set('catppuccin_mocha.omp.json', newThemeConfig('IrwinJuic
continue;
}

console.info(`Exported ${theme}`);
console.info(`Exported ${theme} to ${image}`);

const themeName = theme.slice(0, -9);
const image = themeName + '.png';
const toPath = path.join(themesStaticDir, image);

await fs.promises.rename(image, toPath);
Expand Down

0 comments on commit cf8c71c

Please sign in to comment.