From e75e008507c81fbff83be19a13c47bdd2b62fd49 Mon Sep 17 00:00:00 2001 From: Vladyslav Hrytsenko Date: Wed, 27 Nov 2024 09:33:13 +0200 Subject: [PATCH] fixes to fonts --- packages/nexrender-action-fonts/index.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/nexrender-action-fonts/index.js b/packages/nexrender-action-fonts/index.js index 8c238346..e117439b 100644 --- a/packages/nexrender-action-fonts/index.js +++ b/packages/nexrender-action-fonts/index.js @@ -5,18 +5,19 @@ const { name } = require("./package.json"); const installMac = async (settings, job, fontpath) => { const fontdir = path.join(process.env.HOME, "Library", "Fonts"); + const fontdest = path.join(fontdir, path.basename(fontpath)); if (!fs.existsSync(fontdir)) { fs.mkdirSync(fontdir, { recursive: true }); } - if (fs.existsSync(fontpath)) { - settings.logger.log(`[action-fonts] Font ${fontpath} already exists, skipping.`); + if (fs.existsSync(fontdest)) { + settings.logger.log(`[action-fonts] Font ${fontdest} already exists, skipping.`); return 0; } - settings.logger.log(`[action-fonts] Installing font ${fontpath} to ${fontdir}...`); - fs.copyFileSync(fontpath, path.join(fontdir, path.basename(fontpath))); + settings.logger.log(`[action-fonts] Installing font ${fontpath} to ${fontdest}...`); + fs.copyFileSync(fontpath, fontdest); return 1; }; @@ -34,7 +35,7 @@ const installWin = async (settings, job, fontpath) => { return 0; } - settings.logger.log(`[action-fonts] Installing font ${fontpath} to ${fontdir}...`); + settings.logger.log(`[action-fonts] Installing font ${fontpath} to ${fontdest}...`); fs.copyFileSync(fontpath, fontdest); const fontdisplayname = path.basename(fontpath, path.extname(fontpath)).replace(/-/g, " ");