GitHubFile  = require './github-file'

module.exports =
  activate: ->
    return unless project.getRepo()?

    rootView.command 'github:open', ->
      if itemPath = rootView.getActivePaneItem()?.getPath?()
        GitHubFile.fromPath(itemPath).open()

    rootView.command 'github:blame', ->
      if itemPath = rootView.getActivePaneItem()?.getPath?()
        GitHubFile.fromPath(itemPath).blame()

GitHubFile  = require './github-file'

module.exports =
  activate: ->
    return unless project.getRepo()?

    rootView.eachPane (pane) ->
      pane.command 'github:open', ->
        if itemPath = rootView.getActivePaneItem()?.getPath?()
          GitHubFile.fromPath(itemPath).open()

      pane.command 'github:blame', ->
        if itemPath = rootView.getActivePaneItem()?.getPath?()
          GitHubFile.fromPath(itemPath).blame()

Enable commands only when a file pane is active
Enable commands only when a file pane is active

If there are no file panes open in Atom, it doesn't make sense to show the
github:open and github:blame commands in the command palette. So, instead of
_always_ making these commands available, let's make them available only when
a file pane is active.
