Updater debug utility

This commit is contained in:
Fedor Indutny 2021-06-30 14:27:18 -07:00 committed by GitHub
parent e7e9021e3f
commit 759ced3417
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 409 additions and 15 deletions

View file

@ -40,8 +40,13 @@ const { platform } = process;
export const ACK_RENDER_TIMEOUT = 10000;
export type UpdaterInterface = {
force(): Promise<void>;
};
export async function checkForUpdates(
logger: LoggerType
logger: LoggerType,
forceUpdate = false
): Promise<{
fileName: string;
version: string;
@ -55,8 +60,11 @@ export async function checkForUpdates(
return null;
}
if (isVersionNewer(version)) {
logger.info(`checkForUpdates: found newer version ${version}`);
if (forceUpdate || isVersionNewer(version)) {
logger.info(
`checkForUpdates: found newer version ${version} ` +
`forceUpdate=${forceUpdate}`
);
return {
fileName: getUpdateFileName(yaml),