I think `atom.project.getPath()` should be used here, since the directory containing the target file is not necessarily project root directory.