Look in ~/.local/bin preferentially

This commit is contained in:
Kovid Goyal 2020-12-29 11:50:11 +05:30
parent 175ff4b955
commit c1b7023e3a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -546,6 +546,7 @@ def find_exe(name: str) -> Optional[str]:
paths = system_paths_on_macos()
else:
paths = ['/usr/local/bin', '/opt/bin', '/usr/bin', '/bin', '/usr/sbin', '/sbin']
paths.insert(0, os.path.expanduser('~/.local/bin'))
path = os.pathsep.join(paths) + os.pathsep + os.defpath
ans = shutil.which(name, path=path)
return ans