linter: $PATH is not available on OSX when not launched from CLI

Ideas people? I had thought of parsing ~/.bashrc or similar of users to extract the values ourselves but that doesn’t seem like the best solution.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 141 (42 by maintainers)

Most upvoted comments

Latest version here, using El Capitan and ZSH. Having this issue with a few linters. Adding the following to my init seems to the trick.

exec = require('child_process').exec
exec('source ~/.zshrc')

childProcess = require('child_process')
process.env.PATH = childProcess.execFileSync(process.env.SHELL, ['-i', '-c', 'echo $PATH']).toString().trim()

Similar problem here: AtomLinter/linter-clang#200