From ebfd117c64bf886b9ae9c393e5266ec3b6122eaa Mon Sep 17 00:00:00 2001 From: pompurin404 Date: Mon, 23 Sep 2024 20:03:49 +0800 Subject: [PATCH] fix gist --- changelog.md | 5 +++++ src/main/resolve/gistApi.ts | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index dc15f977..4d3ed8fd 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,11 @@ - 为了修复macOS应用内更新问题,此版本需要手动下载dmg进行安装 +### Features + +- 支持自定义延迟测试并发数量 +- 完善Sub-Store环境变量 + ### Bug Fixes - 修复macOS应用内更新后权限丢失的问题 diff --git a/src/main/resolve/gistApi.ts b/src/main/resolve/gistApi.ts index c879afa0..2e30700e 100644 --- a/src/main/resolve/gistApi.ts +++ b/src/main/resolve/gistApi.ts @@ -80,7 +80,13 @@ export async function getGistUrl(): Promise { if (gist) { return gist.html_url } else { - throw new Error('Gist not found') + await uploadRuntimeConfig() + const gists = await listGists(githubToken) + const gist = gists.find( + (gist) => gist.description === 'Auto Synced Mihomo Party Runtime Config' + ) + if (!gist) throw new Error('Gist not found') + return gist.html_url } } @@ -88,7 +94,6 @@ export async function uploadRuntimeConfig(): Promise { const { githubToken } = await getAppConfig() if (!githubToken) return const gists = await listGists(githubToken) - console.log(gists) const gist = gists.find((gist) => gist.description === 'Auto Synced Mihomo Party Runtime Config') const config = await getRuntimeConfigStr() if (gist) {