     # Our build command works in the same way as erlang-flymake.el
     # see: https://github.com/erlang/otp/blob/maint/lib/tools/emacs/erlang-flymake.el
     command = []
+
     userErlcPath = atom.config.get('atom-lint.erlc.path')
-
-    fileFullPath = @filePath
-    filePathPart = path.dirname(fileFullPath)
 
     if userErlcPath?
       command.push(userErlcPath)
     else
       command.push('erlc')
 
-    if filePathPart.endsWith("/src")
-      parentPathPart = filePathPart.replace('/src', '/')
-      command.push('-I', "#{ parentPathPart }include/")
-      command.push('-I', "#{ parentPathPart }deps/")
-      command.push('-pa', "#{ parentPathPart }ebin/")
+    directoryPath = path.dirname(@filePath)
+
+    if directoryPath.endsWith('/src')
+      projectRoot = path.dirname(projectRoot)
+      command.push('-I', path.join(projectRoot, 'include'))
+      command.push('-I', path.join(projectRoot, 'deps'))
+      command.push('-pa', path.join(projectRoot, 'ebin'))
 
     command.push('-Wall')
     command.push('+warn_obsolete_guard')

    command.push('+warn_export_vars')
    command.push('+strong_validation')
    command.push('+report')
    command.push(fileFullPath)
    # console.log(command.join(' ')) # Show the command
    command

      return callback(error) if error?

      if result.exitCode == 0 || result.exitCode == 1
        violations = @parseLog(result.stdout)
        callback(null, violations)
      else
        callback(new Error("Process exited with code #{result.exitCode}"))

  parseLog: (log) ->
    # Example of erlc output
    # $ erlc <options> hello.erl
    # hello.erl:3: function goofy/1 undefined          # an error
