Move assert to a different Updater method

This commit is contained in:
Fedor Indutny 2022-02-25 11:02:09 -08:00 committed by GitHub
parent 29c2f77d40
commit 163777f751
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -177,6 +177,10 @@ export abstract class Updater {
if (!updateFilePath) {
logger.warn('downloadAndInstall: no update was downloaded');
strictAssert(
mode !== DownloadMode.Automatic && mode !== DownloadMode.FullOnly,
'Automatic and full mode downloads are guaranteed to happen or error'
);
return false;
}
@ -509,10 +513,6 @@ export abstract class Updater {
}
if (!gotUpdate) {
strictAssert(
mode !== DownloadMode.Automatic && mode !== DownloadMode.FullOnly,
'Automatic and full mode downloads are guaranteed to happen or error'
);
return undefined;
}