mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 01:45:28 +00:00
[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.
This commit is contained in:
parent
e5ec8e25b3
commit
7a617d35f3
|
@ -28,7 +28,6 @@ from legendary.utils.env import is_windows_mac_or_pyi
|
||||||
from legendary.utils.eos import add_registry_entries, query_registry_entries, remove_registry_entries
|
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.lfs import validate_files, clean_filename
|
||||||
from legendary.utils.selective_dl import get_sdl_appname
|
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
|
from legendary.utils.wine_helpers import read_registry, get_shell_folders
|
||||||
|
|
||||||
# todo custom formatter for cli logger (clean info, highlighted error/warning)
|
# todo custom formatter for cli logger (clean info, highlighted error/warning)
|
||||||
|
@ -2925,7 +2924,9 @@ def main():
|
||||||
continue
|
continue
|
||||||
print(f'\nCommand: {choice}')
|
print(f'\nCommand: {choice}')
|
||||||
print(subparser.format_help())
|
print(subparser.format_help())
|
||||||
elif os.name == 'nt' and double_clicked():
|
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('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')
|
print('Follow https://github.com/derrod/legendary/wiki/Setup-Instructions to set it up properly')
|
||||||
subprocess.Popen(['cmd', '/K', 'echo>nul'])
|
subprocess.Popen(['cmd', '/K', 'echo>nul'])
|
||||||
|
|
Loading…
Reference in a new issue