Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

Commit

Permalink
fix gist
Browse files Browse the repository at this point in the history
  • Loading branch information
pompurin404 committed Sep 23, 2024
1 parent 09847fe commit 0a725fb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/resolve/gistApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,20 @@ export async function getGistUrl(): Promise<string> {
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
}
}

export async function uploadRuntimeConfig(): Promise<void> {
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) {
Expand Down

0 comments on commit 0a725fb

Please sign in to comment.