Skip to content

Commit

Permalink
docs: 使用 number-to-emoji 库将数字转换为表情符号
Browse files Browse the repository at this point in the history
更新 readme 中的文本,使用表情符号代替数字。
  • Loading branch information
alanhe421 committed May 19, 2024
1 parent d427bfd commit e052d87
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const fs = require('fs');
const {execSync} = require('child_process');
const path = require('path');
const plist = require('plist');
const Numbers = require('number-to-emoji');
const [, , action] = process.argv;
const querystring = require('querystring');

Expand Down Expand Up @@ -39,7 +40,7 @@ async function updateHomeReadme(items) {
arr.push(`${await buildBadgeContent(item.plistObj, item.folderName, item.filename)}`);
map.push(arr.join('\n'));
}
const workflowList = [isEn ? `There are ${items.length} workflows` : `共${items.length}个`,
const workflowList = [isEn ? `There are ${Numbers.toEmoji(items.length)} workflows` : `共${Numbers.toEmoji(items.length)}个`,
...map];
const workflowsListStr = workflowList.join('\n');
const newReadmeContent = readmeContent.replace(/(?<=<!--workflow-start-->)[\s\S]*(?=<!--workflow-end-->)/, workflowsListStr)
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"dependencies": {
"number-to-emoji": "^1.0.0",
"plist": "^3.1.0"
}
}

0 comments on commit e052d87

Please sign in to comment.