2023-04-22 12:14:22 +08:00
|
|
|
import { warning } from "ci-log"
|
2023-05-25 13:07:48 +08:00
|
|
|
import updateNotifier from "simple-update-notifier"
|
|
|
|
import packageJson from "../package.json" assert { type: "json" }
|
2023-04-22 12:14:22 +08:00
|
|
|
|
|
|
|
// auto self update notifier
|
|
|
|
export async function checkUpdates() {
|
|
|
|
try {
|
2023-05-25 13:07:48 +08:00
|
|
|
await updateNotifier({ pkg: packageJson })
|
2023-04-22 12:14:22 +08:00
|
|
|
} catch (err) {
|
2023-05-24 12:37:34 +08:00
|
|
|
warning(`Failed to check for updates: ${err instanceof Error ? err.message + err.stack : err}`)
|
2023-04-22 12:14:22 +08:00
|
|
|
}
|
|
|
|
}
|