mirror of https://github.com/msgbyte/tailchat
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
861 B
TypeScript
37 lines
861 B
TypeScript
import { app } from 'electron';
|
|
import {
|
|
setUpdateNotification,
|
|
checkForUpdates,
|
|
} from 'electron-update-notifier';
|
|
import updateElectronApp from 'update-electron-app';
|
|
import logger from 'electron-log';
|
|
|
|
const repo = 'msgbyte/tailchat';
|
|
|
|
app.whenReady().then(() => {
|
|
switch (process.platform) {
|
|
// case 'darwin': // NOTICE: require codesign
|
|
case 'win32':
|
|
updateElectronApp({
|
|
repo,
|
|
logger,
|
|
});
|
|
break;
|
|
default:
|
|
setUpdateNotification({
|
|
repository: repo, // Optional, use repository field from your package.json when not specified
|
|
silent: true, // Optional, notify when new version available, otherwise remain silent
|
|
});
|
|
}
|
|
});
|
|
|
|
/**
|
|
* 手动检查更新
|
|
*/
|
|
export function checkUpdates(): Promise<void> {
|
|
return checkForUpdates({
|
|
repository: repo,
|
|
silent: false,
|
|
});
|
|
}
|