mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
fix: smart core version fetch logic
This commit is contained in:
parent
1260b8fb4e
commit
dab2ead5fd
@ -46,27 +46,32 @@ async function getLatestAlphaVersion() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ======= mihomo smart ======= */
|
/* ======= mihomo smart ======= */
|
||||||
|
const MIHOMO_SMART_VERSION_URL =
|
||||||
|
'https://github.com/vernesong/mihomo/releases/download/Prerelease-Alpha/version.txt'
|
||||||
const MIHOMO_SMART_URL_PREFIX = `https://github.com/vernesong/mihomo/releases/download/Prerelease-Alpha`
|
const MIHOMO_SMART_URL_PREFIX = `https://github.com/vernesong/mihomo/releases/download/Prerelease-Alpha`
|
||||||
let MIHOMO_SMART_VERSION
|
let MIHOMO_SMART_VERSION
|
||||||
|
|
||||||
const MIHOMO_SMART_MAP = {
|
const MIHOMO_SMART_MAP = {
|
||||||
'win32-x64': 'mihomo-windows-amd64-v1-go120-alpha-smart',
|
'win32-x64': 'mihomo-windows-amd64-v2-go120',
|
||||||
'win32-ia32': 'mihomo-windows-386-go120-alpha-smart',
|
'win32-ia32': 'mihomo-windows-386-go120',
|
||||||
'win32-arm64': 'mihomo-windows-arm64-alpha-smart',
|
'win32-arm64': 'mihomo-windows-arm64',
|
||||||
'darwin-x64': 'mihomo-darwin-amd64-v1-go120-alpha-smart',
|
'darwin-x64': 'mihomo-darwin-amd64-v2-go120',
|
||||||
'darwin-arm64': 'mihomo-darwin-arm64-alpha-smart',
|
'darwin-arm64': 'mihomo-darwin-arm64',
|
||||||
'linux-x64': 'mihomo-linux-amd64-v1-go120-alpha-smart',
|
'linux-x64': 'mihomo-linux-amd64-v2-go120',
|
||||||
'linux-arm64': 'mihomo-linux-arm64-alpha-smart'
|
'linux-arm64': 'mihomo-linux-arm64'
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getLatestSmartVersion() {
|
async function getLatestSmartVersion() {
|
||||||
try {
|
try {
|
||||||
// Smart 内核版本
|
const response = await fetch(MIHOMO_SMART_VERSION_URL, {
|
||||||
MIHOMO_SMART_VERSION = 'ca46a10'
|
method: 'GET'
|
||||||
console.log(`Using smart version: ${MIHOMO_SMART_VERSION}`)
|
})
|
||||||
|
let v = await response.text()
|
||||||
|
MIHOMO_SMART_VERSION = v.trim() // Trim to remove extra whitespaces
|
||||||
|
console.log(`Latest smart version: ${MIHOMO_SMART_VERSION}`)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error with smart version:', error.message)
|
console.error('Error fetching latest smart version:', error.message)
|
||||||
throw error
|
process.exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user