Skip to content

Commit

Permalink
ci: update scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jul 24, 2024
1 parent fdb4941 commit 4226bcc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
Binary file modified docs/pinyin-regular.ttf
Binary file not shown.
Binary file modified docs/pinyin-step.ttf
Binary file not shown.
3 changes: 2 additions & 1 deletion scripts/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ function svgFontToTTF(src = "./docs/pinyin.svg", dist = "./docs/pinyin.ttf") {
const pkg = fs.readJsonSync('./package.json');
const fileContent = fs.readFileSync('./docs/index.html', 'utf-8');
let updatedContent = fileContent.replace(/<sup>.*<\/sup>/g, `<sup>v${pkg.version}</sup>`);
updatedContent = fileContent.replace(/url\('.\/pinyin-step.*\.ttf'\)/g, `url('./pinyin-step.ttf?v=${pkg.version}')`);
updatedContent = fileContent.replace(/url\('.\/pinyin-step\.ttf.*'\)\s/g, `url('./pinyin-step.ttf?v=${pkg.version}') `);
updatedContent = fileContent.replace(/url\('.\/pinyin-regular\.ttf.*'\)\s/g, `url('./pinyin-regular.ttf?v=${pkg.version}') `);
fs.writeFileSync('./docs/index.html', updatedContent);
})()

0 comments on commit 4226bcc

Please sign in to comment.