chore: update public repo

This commit is contained in:
desu-bot 2025-02-19 02:30:26 +00:00
parent c118bcbfc3
commit f02ccb6029
No known key found for this signature in database
12 changed files with 510 additions and 2 deletions

View file

@ -2,7 +2,7 @@ import { readFile } from 'node:fs/promises'
import { join } from 'node:path'
import plist from 'plist'
import { z } from 'zod'
import { $ } from 'zx'
import { $, sleep } from 'zx'
import { ffetch } from '../../utils/fetch.ts'
const latestVerInfo = await ffetch('https://api.github.com/repos/forkgram/tdesktop/releases/latest').parsedJson(
@ -40,12 +40,17 @@ if (!arm64Asset) {
console.log('installing new version...')
await $`curl -L ${arm64Asset.browser_download_url} -o /tmp/forkgram.zip`
await $`unzip -o /tmp/forkgram.zip -d /tmp/forkgram`
await $`kill -9 $(pgrep -f /Applications/Forkgram.app/Contents/MacOS/Telegram)`
const pid = await $`/usr/bin/pgrep -f /Applications/Forkgram.app/Contents/MacOS/Telegram`.text().catch(() => null)
if (pid) {
await $`kill -9 ${pid.trim()}`
}
await $`rm -rf ${INSTALL_PATH}`
await $`mv /tmp/forkgram/Telegram.app ${INSTALL_PATH}`
await $`rm -rf /tmp/forkgram`
await $`xattr -cr ${INSTALL_PATH}`
await sleep(1000)
await $`open ${INSTALL_PATH}`
console.log('✅ done')