Skip to content

Commit 7a617d3

Browse files
committed
[cli] Fix double-click check breaking macOS/Linux execution
By always trying to import windows_helpers and thus winreg on non-Windows things would break.
1 parent e5ec8e2 commit 7a617d3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

legendary/cli.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
from legendary.utils.eos import add_registry_entries, query_registry_entries, remove_registry_entries
2929
from legendary.utils.lfs import validate_files, clean_filename
3030
from legendary.utils.selective_dl import get_sdl_appname
31-
from legendary.utils.windows_helpers import double_clicked
3231
from legendary.utils.wine_helpers import read_registry, get_shell_folders
3332

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

29342935
cli = LegendaryCLI(override_config=args.config_file, api_timeout=args.api_timeout)

0 commit comments

Comments
 (0)