一键迁移TRSS-Yunzai
This commit is contained in:
parent
7d351536be
commit
f2a4c1690d
|
@ -15,6 +15,7 @@
|
||||||
* **移除了签到功能:** 与原Yunzai独立的仓库,去除了较为敏感的签到功能,以尝试恢复[Github](https://github.com/yoimiya-kokomi/Miao-Yunzai.git)
|
* **移除了签到功能:** 与原Yunzai独立的仓库,去除了较为敏感的签到功能,以尝试恢复[Github](https://github.com/yoimiya-kokomi/Miao-Yunzai.git)
|
||||||
环境。附加[Gitee](https://gitee.com/yoimiya-kokomi/Miao-Yunzai.git)
|
环境。附加[Gitee](https://gitee.com/yoimiya-kokomi/Miao-Yunzai.git)
|
||||||
* **默认启用喵版的功能:** 【#角色】【#深渊】【#帮助】等功能默认启用喵版,原版的逻辑会屏蔽,以便于后续逐步精简资源
|
* **默认启用喵版的功能:** 【#角色】【#深渊】【#帮助】等功能默认启用喵版,原版的逻辑会屏蔽,以便于后续逐步精简资源
|
||||||
|
* **一键迁移 TRSS-Yunzai:** 若无法登录QQ,可尝试 `node trss` 迁移,迁移后可登录其他协议端 [TRSS-Yunzai](https://gitee.com/TimeRainStarSky/Yunzai)
|
||||||
|
|
||||||
## Miao-Yunzai后续计划
|
## Miao-Yunzai后续计划
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
console.log("正迁移到 TRSS-Yunzai\n")
|
||||||
|
|
||||||
|
import fs from "node:fs"
|
||||||
|
import { execSync } from "child_process"
|
||||||
|
|
||||||
|
function exec(cmd) { try {
|
||||||
|
console.log(`执行命令 [${cmd}]\n`)
|
||||||
|
console.log(execSync(cmd).toString())
|
||||||
|
return true
|
||||||
|
} catch (err) {
|
||||||
|
console.error(`错误:执行命令失败:${err}`)
|
||||||
|
return false
|
||||||
|
}}
|
||||||
|
|
||||||
|
function rmFile(file) { try {
|
||||||
|
console.log(`删除文件 [${file}]\n`)
|
||||||
|
fs.unlinkSync(file)
|
||||||
|
return true
|
||||||
|
} catch (err) {
|
||||||
|
console.error(`错误:删除文件失败:${err}`)
|
||||||
|
return false
|
||||||
|
}}
|
||||||
|
|
||||||
|
function rmDir(dir) { try {
|
||||||
|
for (const i of fs.readdirSync(dir)) {
|
||||||
|
const path = `${dir}/${i}`
|
||||||
|
if (fs.statSync(path).isDirectory())
|
||||||
|
rmDir(path)
|
||||||
|
else
|
||||||
|
rmFile(path)
|
||||||
|
}
|
||||||
|
console.log(`删除文件夹 [${dir}]\n`)
|
||||||
|
fs.rmdirSync(dir)
|
||||||
|
return true
|
||||||
|
} catch (err) {
|
||||||
|
console.error(`错误:删除文件夹失败:${err}`)
|
||||||
|
return false
|
||||||
|
}}
|
||||||
|
|
||||||
|
exec("git remote add trss https://gitee.com/TimeRainStarSky/Yunzai")
|
||||||
|
exec("git fetch trss main")
|
||||||
|
rmDir("config/config")
|
||||||
|
exec("git reset --hard")
|
||||||
|
exec("git clean -df")
|
||||||
|
exec("git checkout --track trss/main")
|
||||||
|
rmDir("plugins/genshin")
|
||||||
|
exec("git clone https://gitee.com/TimeRainStarSky/Yunzai-genshin plugins/genshin")
|
||||||
|
exec("pnpm i")
|
||||||
|
|
||||||
|
console.log("迁移完成,请查看教程 启动协议端\nhttps://gitee.com/TimeRainStarSky/Yunzai")
|
Loading…
Reference in New Issue