]> arthur.barton.de Git - atom-ax-pipe.git/blobdiff - lib/pipe.coffee
Make it work when a file is opened without a project
[atom-ax-pipe.git] / 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()