Sha256: 1679af8bf38898c5b82705385371f54b48a2a0c5b30df4b599d1f1dc3031459c

Contents?: true

Size: 1022 Bytes

Versions: 1

Compression:

Stored size: 1022 Bytes

Contents

module Fastlane
  class LaneList
    # Print out the result of `generate`
    def self.output(path)

      puts generate(path)

      puts "Execute using `fastlane [lane_name]`".yellow
    end

    def self.generate(path)
      ff = Fastlane::FastFile.new(path)
      output = ""
      
      all_keys = ff.runner.lanes.keys.reject(&:nil?) 
      all_keys.unshift(nil) # because we want root elements on top. always! They have key nil

      all_keys.each do |platform|
        next if (ff.runner.lanes[platform] || []).count == 0
        plat_text = platform
        plat_text = "general" if platform.to_s.empty?
        output += "\n--------- #{plat_text}---------\n".yellow
      
        value = ff.runner.lanes[platform]
        
        if value
          value.each do |lane_name, lane|
            output += "----- fastlane #{lane.pretty_name}".green
            output += "\n" + lane.description.join("\n") + "\n\n" if lane.description.count > 0
          end
        end
      end

      output
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fastlane-1.9.0 lib/fastlane/lane_list.rb