Skip to content

Commit

Permalink
fixed dest calculatiob
Browse files Browse the repository at this point in the history
  • Loading branch information
inlife committed Nov 3, 2024
1 parent 3c7ae48 commit b7fdf0c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/nexrender-action-fonts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ const installWin = async (job, fontpath) => {
fs.mkdirSync(fontdir, { recursive: true });
}

fs.copyFileSync(fontpath, path.join(fontdir, path.basename(fontpath)));
const fontdest = path.join(fontdir, path.basename(fontpath));
fs.copyFileSync(fontpath, fontdest);

const fontdisplayname = path.basename(fontpath, path.extname(fontpath)).replace(/-/g, " ");
const fontreg = `reg add "HKCU\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts" /v "${fontdisplayname} (TrueType)" /t REG_SZ /d "${fontpath}" /f`;
const fontreg = `reg add "HKCU\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Fonts" /v "${fontdisplayname} (TrueType)" /t REG_SZ /d "${fontdest}" /f`;

execSync(fontreg);
};
Expand Down

0 comments on commit b7fdf0c

Please sign in to comment.