mirror of
https://github.com/lutris/lutris.git
synced 2026-05-24 06:39:22 -04:00
Merge pull request #6349 from Zebra2711/fix-9
fix warning `executable file does not exist`
This commit is contained in:
@@ -109,16 +109,20 @@ def _get_prefix_warning(_option_key: str, config: LutrisConfig) -> Optional[str]
|
||||
|
||||
def _get_exe_warning(_option_key: str, config: LutrisConfig) -> Optional[str]:
|
||||
exe = config.game_config.get("exe")
|
||||
working_dir = config.game_config.get("working_dir")
|
||||
if not exe:
|
||||
return _("<b>Warning</b> No executable path specified")
|
||||
_exe = exe.strip()
|
||||
good_path = exe == _exe
|
||||
if not _exe:
|
||||
return _("<b>Warning</b> No executable path specified")
|
||||
if good_path and os.path.isfile(_exe):
|
||||
return None
|
||||
elif not good_path:
|
||||
if not good_path:
|
||||
return _("<b>Warning</b> Executable path has extra whitespace at the beginning or end")
|
||||
if os.path.isfile(_exe):
|
||||
return None
|
||||
if working_dir is not None:
|
||||
if os.path.isfile(os.path.join(working_dir, _exe)):
|
||||
return None
|
||||
return _("<b>Warning</b> Executable file does not exist")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user