lsegal / atom-rst-preview

Open a rendered version of the ReStructuredText in the current editor with `ctrl-shift-r`.
Other
22 stars 80 forks source link

Depending on how atom is launched pandoc might not be found #27

Closed geekpete closed 9 years ago

geekpete commented 9 years ago

Seems to be this atom bug where the user's true path config is not loaded correctly depending on how atom is launched: https://github.com/AtomLinter/Linter/issues/150

This can manifest with this plugin as an error like:

'pandoc' could not be spawned. 
Is it installed and on your path? 
If so please open an issue on the package spawning the process.

This error is avoided if launching "atom" from the terminal. But if you then pin the atom icon to the OSX dock, close atom then relaunch it from the OSX dock, the pandoc not found error will occur due to issues loading /usr/local/bin into the path.

Until this atom bug is fixed, a workaround that worked for me was to add the following config to the ~/.atom/init.coffee file the relaunch from the OSX dock:

process.env.PATH = ["/usr/bin",
                    "/usr/local/bin",
                    ].join(":")

This plugin's README file could mention this issue (for OSX users anyway) and suggest the workaround so that users can avoid hitting this path issue with the plugin.

Testing was just to copy/paste this content into a new tab and hitting ctrl-shift-r: https://raw.githubusercontent.com/ralsina/rst-cheatsheet/master/rst-cheatsheet.rst

Cheers.

geekpete commented 9 years ago

Added a pull request to for the README file: https://github.com/lsegal/atom-rst-preview/pull/28

lsegal commented 9 years ago

Fixed by #28