]> arthur.barton.de Git - atom-ax-pipe.git/commitdiff
Make it work when a file is opened without a project
author= <brandonhorst@gmail.com>
Thu, 13 Nov 2014 18:34:48 +0000 (13:34 -0500)
committer= <brandonhorst@gmail.com>
Thu, 13 Nov 2014 18:34:48 +0000 (13:34 -0500)
lib/pipe.coffee

index 5ccd6b0349fa0c321b1a077583a12a12186f2ca8..5294840bd507d0833bc6a85f296f20a40320056f 100644 (file)
@@ -22,7 +22,8 @@ module.exports =
       if history.length > 300
         history.shift()
 
-      commandString = "cd '#{atom.project.rootDirectory.path}' && #{commandString}"
+      if atom.project.rootDirectory?
+        commandString = "cd '#{atom.project.rootDirectory.path}' && #{commandString}"
       properties = { reversed: true, invalidate: 'never' }
 
       for range in editor.getSelectedBufferRanges()