[F] Fix #286: Termux missing /usr/bin/env

This commit is contained in:
Azalea 2024-05-16 01:33:30 +08:00
parent 566011efff
commit d41a302e44

View file

@ -245,7 +245,8 @@ def run_neofetch_cmd(args: str, pipe: bool = False) -> str | None:
Run neofetch command
"""
if platform.system() != 'Windows':
full_cmd = ['/usr/bin/env', 'bash', get_command_path(), *shlex.split(args)]
bash = ['/usr/bin/env', 'bash'] if Path('/usr/bin/env').is_file() else [shutil.which('bash')]
full_cmd = [*bash, get_command_path(), *shlex.split(args)]
else:
cmd = get_command_path().replace("\\", "/").replace("C:/", "/c/")