".github/vscode:/vscode.git/clone" did not exist on "5dbd1df4b62a8fd33d93fe0a3c5f1bb9c3660e7c"
install_utils.py 639 Bytes
Newer Older
root's avatar
root committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os
from typing import List, Optional


def print_warning(*lines: str) -> None:
    print('**************************************************')
    for line in lines:
        print('*** WARNING: %s' % line)
    print('**************************************************')


def get_path(key: str) -> List[str]:
    return os.environ.get(key, '').split(os.pathsep)


def search_on_path(filenames: List[str]) -> Optional[str]:
    for p in get_path('PATH'):
        for filename in filenames:
            full = os.path.join(p, filename)
            if os.path.exists(full):
                return os.path.abspath(full)
    return None