Skip to content

Commit

Permalink
[cli] Fix double-click check breaking macOS/Linux execution
Browse files Browse the repository at this point in the history
By always trying to import windows_helpers and thus winreg on
non-Windows things would break.
  • Loading branch information
derrod committed Jun 24, 2022
1 parent e5ec8e2 commit 7a617d3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions legendary/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from legendary.utils.eos import add_registry_entries, query_registry_entries, remove_registry_entries
from legendary.utils.lfs import validate_files, clean_filename
from legendary.utils.selective_dl import get_sdl_appname
from legendary.utils.windows_helpers import double_clicked
from legendary.utils.wine_helpers import read_registry, get_shell_folders

# todo custom formatter for cli logger (clean info, highlighted error/warning)
Expand Down Expand Up @@ -2925,10 +2924,12 @@ def main():
continue
print(f'\nCommand: {choice}')
print(subparser.format_help())
elif os.name == 'nt' and double_clicked():
print('Please note that this is not the intended way to run Legendary.')
print('Follow https://github.com/derrod/legendary/wiki/Setup-Instructions to set it up properly')
subprocess.Popen(['cmd', '/K', 'echo>nul'])
elif os.name == 'nt':
from legendary.utils.windows_helpers import double_clicked
if double_clicked():
print('Please note that this is not the intended way to run Legendary.')
print('Follow https://github.com/derrod/legendary/wiki/Setup-Instructions to set it up properly')
subprocess.Popen(['cmd', '/K', 'echo>nul'])
return

cli = LegendaryCLI(override_config=args.config_file, api_timeout=args.api_timeout)
Expand Down

0 comments on commit 7a617d3

Please sign in to comment.