Files
SodiumPet/tools/patch-readme-download.cjs

26 lines
1.4 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const fs = require('fs')
const p = 'C:/Users/ASUS/Documents/deepseek-harness/default-workspace/desktop-pet/README.md'
let text = fs.readFileSync(p, 'utf8')
const section = `## 下载(Windows 直接可运行)
> ⚠️ **不要点仓库右上角的 "Code → Download ZIP"**:那是**源代码**,里面没有 exe(\`out/\`、\`release/\` 都不入库)。要能直接运行的版本,请从 **Releases** 下载。
- **GitHub(推荐)**:<https://github.com/Tian-XiaRi/SodiumPet/releases/latest>
- 下载 \`SodiumPet-0.1.0-win64.zip\`(约 171MB)→ 解压 → 双击里面的 \`SodiumPet.exe\`
- **Gitee 国内镜像**:<https://gitee.com/TianXiaRi/sodium-pet/releases>
- 下载 \`SodiumPet-0.1.0-win64.7z.001\` 和 \`.002\` **两个分卷**(单个附件限 100MB)→ 放在同一个文件夹 → 用 [7-Zip](https://www.7-zip.org/) 右键 \`.001\` → 解压 → 双击 \`SodiumPet.exe\`
运行环境:Windows 10/11 x64。首次启动若弹出 SmartScreen「Windows 已保护你的电脑」,点「更多信息 → 仍要运行」(未做代码签名,正常现象)。
`
if (!text.includes('## 下载(Windows 直接可运行)')) {
const idx = text.indexOf('## 功能一览')
text = text.slice(0, idx) + section + text.slice(idx)
fs.writeFileSync(p, text, 'utf8')
console.log('download section added')
} else {
console.log('already present')
}