fix macos updater

This commit is contained in:
pompurin404 2024-10-08 21:59:01 +08:00
parent 9be085dd90
commit ccc03c8ae0
No known key found for this signature in database

View File

@ -95,11 +95,11 @@ export async function downloadAndInstallUpdate(version: string): Promise<void> {
`hdiutil attach "${path.join(dataDir(), file)}" -mountpoint "/Volumes/mihomo-party" -nobrowse` `hdiutil attach "${path.join(dataDir(), file)}" -mountpoint "/Volumes/mihomo-party" -nobrowse`
) )
try { try {
await execPromise(`mv /Applications/${name}.app /tmp`) await execPromise(`mv "/Applications/${name}.app" /tmp`)
await execPromise('cp -R "/Volumes/mihomo-party/Mihomo Party.app" /Applications/') await execPromise('cp -R "/Volumes/mihomo-party/Mihomo Party.app" /Applications/')
await execPromise(`rm -rf /tmp/${name}.app`) await execPromise(`rm -rf "/tmp/${name}.app"`)
} catch (e) { } catch (e) {
await execPromise(`mv /tmp/${name}.app /Applications`) await execPromise(`mv "/tmp/${name}.app" /Applications`)
throw e throw e
} finally { } finally {
await execPromise('hdiutil detach "/Volumes/mihomo-party"') await execPromise('hdiutil detach "/Volumes/mihomo-party"')