         #   console.log data
       else
         throw new Error "change directory led to #{pwd}"
-      
-  
+
+
   errorNoGitRepo: -> @notifyUser "No git repo found!", "error"
-    
+
   notifyUser: (message, type = "success") ->
     if type is "success"
       atom.notifications.addSuccess message

  activeItem: -> atom.workspace.activePaneItem

  activeItemPath: -> @activeItem().getPath()
  
  getRepos: ->
    Promise.all(atom.project.getDirectories().map(atom.project.repositoryForDirectory.bind(atom.project)))
  
  getWorkingDirectories: (cb) ->
    @getRepos().then (repositories) ->
      workingDirectories = repositories.map (repo) -> return repo.repo.workingDirectory
      cb.call(null, workingDirectories)
      
      
  
  isFilePath: (path) ->
    stringAfterLastSlash = path.split("/")[-1..]
    if /\./.test stringAfterLastSlash then true else false
    

  doGitWip: (path) ->
    return @errorNoGitRepo() unless atom.project.getRepositories().length > 0
    
    command = "git wip save"
    
    
    @getWorkingDirectories (directories) =>
      # TODO loop if multiple projects
      cdPath = directory = directories[0]

        throw new Error('bin git-wip not found: please install from https://github.com/bartman/git-wip and ensure it is in your bin path')
      else
        self.doGitWip(filePath if filePath?)

    exit = (code) -> console.log "which exite with #{code}"

    process = new BufferedProcess {command: command, args: ["git-wip"], stdout: stdout, exit: exit}






# random commentasdadzxczc cool making changessdkjk
