+meta = require '../package.json'
+
 # Dependencies
 {spawn} = require 'child_process'
 os = require 'os'
+
 module.exports = BridlensisCore =
   config:
     pathToJar:

        bridleJar  = atom.config.get('language-bridlensis.pathToJar')
        
        if not bridleJar
          atom.notifications.addError("**language-bridlensis**: no valid `BridleNSIS.jar` specified in your config", dismissable: false)
          return

        defaultArguments = ["-jar", bridleJar]


  getPath: (callback) ->
    if os.platform() is 'win32'
      whichCmd = spawn('where', ['java'])
    else
      whichCmd = spawn('which', ['java'])

    # Find Java
    whichCmd.stderr.on 'data', (data) ->
      atom.notifications.addError("**#{meta.name}**: Java is not in your `PATH` [environmental variable](http://superuser.com/a/284351/195953)", dismissable: true)
      return

    whichCmd.stdout.on 'data', (data) ->
      callback data
      return
