From cf8c71cd50322bca59e647c2ef7a250433947b1c Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Thu, 11 Jul 2024 23:02:00 +0200 Subject: [PATCH] docs(export): specify output name --- website/export_themes.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/website/export_themes.js b/website/export_themes.js index f5c3d3bc..00faac91 100644 --- a/website/export_themes.js +++ b/website/export_themes.js @@ -42,6 +42,7 @@ themeConfigOverrrides.set('catppuccin_mocha.omp.json', newThemeConfig('IrwinJuic if (!isValidTheme(theme)) { continue; } + const configPath = path.join(themesConfigDir, theme); let config = newThemeConfig(); @@ -49,7 +50,10 @@ themeConfigOverrrides.set('catppuccin_mocha.omp.json', newThemeConfig('IrwinJuic 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}"`; @@ -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);