[cli/core/utils/lfs] Also enable update notification on macOS

This commit is contained in:
derrod 2021-12-02 16:51:48 +01:00
parent 9e21a81c96
commit 6f7989ab50
4 changed files with 10 additions and 6 deletions

View file

@ -24,7 +24,7 @@ from legendary.models.exceptions import InvalidCredentialsError
from legendary.models.game import SaveGameStatus, VerifyResult
from legendary.utils.cli import get_boolean_choice, sdl_prompt
from legendary.utils.custom_parser import AliasedSubParsersAction
from legendary.utils.env import is_windows_or_pyi
from legendary.utils.env import is_windows_mac_or_pyi
from legendary.utils.lfs import validate_files
from legendary.utils.selective_dl import get_sdl_appname
from legendary.utils.wine_helpers import read_registry, get_shell_folders
@ -2117,7 +2117,7 @@ def main():
print(f'- Release summary:\n{update_info["summary"]}\n- Release URL: {update_info["gh_url"]}')
if update_info['critical']:
print('! This update is recommended as it fixes major issues.')
if not is_windows_or_pyi():
if not is_windows_mac_or_pyi():
print('If you installed legendary via a package manager it may '
'take some time for the update to become available.')

View file

@ -33,7 +33,7 @@ from legendary.models.json_manifest import JSONManifest
from legendary.models.manifest import Manifest, ManifestMeta
from legendary.models.chunk import Chunk
from legendary.utils.egl_crypt import decrypt_epic_data
from legendary.utils.env import is_windows_or_pyi
from legendary.utils.env import is_windows_mac_or_pyi
from legendary.utils.game_workarounds import is_opt_enabled, update_workarounds
from legendary.utils.savegame_helper import SaveGameHelper
from legendary.utils.selective_dl import games as sdl_games
@ -242,7 +242,7 @@ class LegendaryCore:
if self.force_show_update:
return True
return not self.lgd.config.getboolean('Legendary', 'disable_update_notice',
fallback=not is_windows_or_pyi())
fallback=not is_windows_mac_or_pyi())
def check_for_updates(self, force=False):
def version_tuple(v):

View file

@ -11,7 +11,7 @@ from time import time
from legendary.models.game import *
from legendary.utils.aliasing import generate_aliases
from legendary.utils.config import LGDConf
from legendary.utils.env import is_windows_or_pyi
from legendary.utils.env import is_windows_mac_or_pyi
from legendary.utils.lfs import clean_filename
@ -99,7 +99,7 @@ class LGDLFS:
self.config.set('Legendary', 'disable_update_check', 'false')
if not self.config.has_option('Legendary', 'disable_update_notice'):
self.config.set('Legendary', '; Disables the notice about an available update on exit')
self.config.set('Legendary', 'disable_update_notice', 'false' if is_windows_or_pyi() else 'true')
self.config.set('Legendary', 'disable_update_notice', 'false' if is_windows_mac_or_pyi() else 'true')
try:
self._installed = json.load(open(os.path.join(self.path, 'installed.json')))

View file

@ -8,3 +8,7 @@ def is_pyinstaller():
def is_windows_or_pyi():
return is_pyinstaller() or os.name == 'nt'
def is_windows_mac_or_pyi():
return is_pyinstaller() or os.name == 'nt' or sys.platform == 'darwin'