setup-cpp/src/check-updates.ts

13 lines
407 B
TypeScript
Raw Normal View History

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