Fix go in home dir getting removed from PATH on CI

This commit is contained in:
Kovid Goyal 2022-08-16 14:49:31 +05:30
parent 1429be3a19
commit 07dc83670b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -26,10 +26,14 @@ def env_vars(**kw: str) -> Iterator[None]:
def main() -> None:
warnings.simplefilter('error')
gohome = os.path.expanduser('~/go')
go = shutil.which('go')
current_home = os.path.expanduser('~') + os.sep
paths = os.environ.get('PATH', '/usr/local/sbin:/usr/local/bin:/usr/bin').split(os.pathsep)
path = os.pathsep.join(x for x in paths if not x.startswith(current_home))
launcher_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'kitty', 'launcher')
if go:
path = f'{os.path.dirname(go)}{os.pathsep}{path}'
path = f'{launcher_dir}{os.pathsep}{path}'
PYTHON_FOR_TYPE_CHECK = shutil.which('python') or shutil.which('python3') or ''
gohome = os.path.expanduser('~/go')