diff --git a/README.md b/README.md index c2edd38..8089e77 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ You can configure linter-json by editing ~/.atom/config.cson (choose Open Your C ``` 'linter-shellcheck': 'shellcheckExecutablePath': null #shellcheck path. run 'which shellcheck' to find the path + 'enableFixPath': enables fix-path optimization; useful when running Atom on OS X to fix PATH issues ``` ## Contributing diff --git a/lib/main.coffee b/lib/main.coffee index 2882023..8ec1cf8 100644 --- a/lib/main.coffee +++ b/lib/main.coffee @@ -10,6 +10,11 @@ module.exports = type: 'boolean' title: 'Enable Notice Messages' default: false + enableFixPath: + type: 'boolean' + title: 'Enable fix-path' + description: 'Fix the `$PATH` on OS X when Atom is run from a GUI app.' + default: process.platform is 'darwin' activate: -> @subscriptions = new CompositeDisposable @@ -20,6 +25,10 @@ module.exports = @subscriptions.add atom.config.observe 'linter-shellcheck.enableNotice', (enableNotice) => @enableNotice = enableNotice + @subscriptions.add atom.config.observe 'linter-shellcheck.enableFixPath', + (enableFixPath) -> + # can not reverse fix-path once loaded + require('fix-path')() if enableFixPath deactivate: -> @subscriptions.dispose() diff --git a/package.json b/package.json index 1edf874..8d30603 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ "atom": ">0.180.0" }, "dependencies": { - "atom-linter": "^3.0.0" + "atom-linter": "^3.0.0", + "fix-path": "^1.0.0" }, "providedServices": { "linter": {