fix: restore mistakenly removed trafficmonitor download component

This commit is contained in:
ezequielnick 2025-08-09 09:49:02 +08:00
parent 5e0c5b6e69
commit ef96819621

View File

@ -323,6 +323,26 @@ const resolveSysproxy = () =>
downloadURL: `https://github.com/mihomo-party-org/sysproxy/releases/download/${arch}/sysproxy.exe`
})
const resolveMonitor = async () => {
const tempDir = path.join(TEMP_DIR, 'TrafficMonitor')
const tempZip = path.join(tempDir, `${arch}.zip`)
if (!fs.existsSync(tempDir)) {
fs.mkdirSync(tempDir, { recursive: true })
}
await downloadFile(
`https://github.com/mihomo-party-org/mihomo-party-run/releases/download/monitor/${arch}.zip`,
tempZip
)
const zip = new AdmZip(tempZip)
const resDir = path.join(cwd, 'extra', 'files')
const targetPath = path.join(resDir, 'TrafficMonitor')
if (fs.existsSync(targetPath)) {
fs.rmSync(targetPath, { recursive: true })
}
zip.extractAllTo(targetPath, true)
console.log(`[INFO]: TrafficMonitor finished`)
}
const resolve7zip = () =>
resolveResource({
@ -413,7 +433,12 @@ const tasks = [
retry: 5,
winOnly: true
},
{
name: 'monitor',
func: resolveMonitor,
retry: 5,
winOnly: true
},
{
name: 'substore',
func: resolveSubstore,