How to require source file in atom


#1

I am attempting to fix a plugin for atom that has the following code.

resourcePath = atom.config.resourcePath
try
  Editor = require path.resolve resourcePath, 'src', 'editor'
catch e
  # Catch error
TextEditor = Editor ? require path.resolve resourcePath, 'src', 'text-editor'

It needs to require the TextEditor class within the source but it appears that atom.config.resourcePath is undefined.

I have the path hardcoded for now and it works but I would like to submit a pull request with a fix.

Thanks!