summaryrefslogtreecommitdiff
path: root/lib/license/finder/ext/go_dep.rb
blob: f2867d34a59483d033e2e9a0c58feb99c0cd9d2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module LicenseFinder
  class GoDep
    def active?
      return if project_path.to_path.include?('/vendor/')

      project_path.join('Godeps/Godeps.json').exist?
    end

    def prepare
      within_project_path do
        tool_box.install(tool: :golang)
        shell.execute([:go, :install, '-i', 'github.com/golang/dep/cmd/dep'], capture: false)
        shell.execute([:asdf, :reshim], capture: false)
      end
    end
  end
end