mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-26 20:50:30 +08:00
fix: restore mistakenly removed trafficmonitor download component
This commit is contained in:
parent
5e0c5b6e69
commit
ef96819621
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user