         # Strip the filename from the path to make sure we pass a directory
         # path. If we pass xdg-open a file path, it will open that file in the
         # most suitable application instead, which is not what we want.
-        pathToOpen =  path.dirname(pathToOpen) if entryType is 'file'
+        pathToOpen =  path.dirname(pathToOpen) if isFile
 
         command: 'xdg-open'
         label: 'File Manager'


  # Get the outline of a system call to the current platform's file manager.
  #
  # entryType   - Either "file" or "directory" to indicate what the path points
  #               to.
  # pathToOpen  - Path to a file or directory.
  #
  # Returns an object containing a command, a human-readable label, and the
  # arguments.
  fileManagerCommandForPath: (entryType, pathToOpen) ->
    switch process.platform
      when 'darwin'
        command: 'open'

  showSelectedEntryInFileManager: ->
    entry = @selectedEntry()
    return unless entry

    {command, args, label} = @fileManagerCommandForPath(entry.getPath(), entry instanceof FileView)

    errorLines = []
    stderr = (lines) -> errorLines.push(lines)
