def extract_path(cmd, delim=':'):
"""Return the user's PATH as a colon-delimited list."""
from . import persist
persist.debug('user shell:', cmd[0])
out = run_shell_cmd(cmd).decode()
path = out.split('__SUBL_PATH__', 2)
if len(path) > 1:
path = path[1]
return ':'.join(path.strip().split(delim))
else:
persist.printf('Could not parse shell PATH output:\n' + (out if out else '<empty>'))
sublime.error_message(
'SublimeLinter could not determine your shell PATH. '
'It is unlikely that any linters will work. '
'\n\n'
'Please see the troubleshooting guide for info on how to debug PATH problems.')
return ''
评论列表
文章目录