Ai
1 Star 0 Fork 452

咸鱼郑某/element-plus

forked from element-plus/element-plus 
Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
build-table.ts 1.24 KB
Copy Edit Raw Blame History
import fs from 'fs/promises'
import path from 'path'
async function main() {
const threshold = process.env.THRESHOLD || 40
let output: string
const diffOutput = await fs.readFile(
path.resolve(__dirname, '..', 'tmp/diff.txt'),
'utf-8'
)
const fileDiffs = diffOutput
.split('\n')
.map((s) => s.trim())
.filter((s) => s)
.map((s) => s.split(':'))
if (fileDiffs.length === 0) {
output = ''
} else {
const table = fileDiffs.reduce(
(prev, [source, filename]) => {
const row = `|${filename}`
let status: 'Added 🟢' | 'Removed ⛔️'
if (!source.startsWith('./dist')) {
status = 'Removed ⛔️'
} else {
status = 'Added 🟢'
}
return `${prev}
${row}|${status}|`
},
`| Filename | Status |
|:---|:---:|`
)
output = `**Total changed files:** ${fileDiffs.length}
${
fileDiffs.length >= threshold
? `#### 🚔 Attention: the changed file has exceeded the threshold`
: ''
}
<details><summary>:information_source: Files have been changed</summary>
${table}
</details>
<sub>Generated with :heart: by Element Plus bot</sub>`
}
await fs.writeFile(path.resolve(__dirname, '..', 'tmp/diff.md'), output)
}
main()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/ZHFHZ/element-plus.git
git@gitee.com:ZHFHZ/element-plus.git
ZHFHZ
element-plus
element-plus
dev

Search