mirror of
https://git.stupid.fish/teidesu/scripts.git
synced 2025-07-28 02:32:11 +10:00
chore: update public repo
This commit is contained in:
parent
c118bcbfc3
commit
f02ccb6029
12 changed files with 510 additions and 2 deletions
|
@ -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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue