 path = require 'path'
 helpers = require 'atom-linter'
 {CompositeDisposable} = require 'atom'
-{statSync} = require "fs"
+{statSync, realpathSync} = require "fs"
 
 
 regex =

    filePath = do textEditor.getPath
    fileName = path.basename do textEditor.getPath
    helpers.tempFile fileName, do textEditor.getText, (tmpFilePath) =>
      tmpFilePath = fs.realpathSync tmpFilePath
      lintInfo = @makeLintInfo tmpFilePath, filePath
      @lintFile lintInfo, textEditor


  makeLintInfo: (fileName, originFileName) =>
    originFileName = fileName if not originFileName
    filePath = path.normalize path.dirname(originFileName)
    tmpFilePath =  if fileName != originFileName then path.dirname(fileName) else filePath
    projectPath = atom.project.relativizePath(originFileName)[0]
    env = @initEnv filePath, projectPath
    args = @initArgs filePath
