class Fastlane::Actions::DartPackageStatusAction

Public Class Methods

run(options) click to toggle source
# File lib/fastlane/plugin/sunny_project/actions/dart_package_status_action.rb, line 26
def self.run(options)
  params = FastlaneCore::Configuration.create(Fastlane::SunnyProject::Options.available_options, {})
  params.load_configuration_file("Sunnyfile")
  options.all_keys.each do |key|
    params.set(key, options[key])
  end
  plugins = params[:sunny_plugins]
  branches = params[:sunny_plugins]
  Dir.chdir(params[:sunny_plugin_folder]) do
    plugins.keys.each do |key|
      folder = plugins[key]
      folder_str = ''
      unless key.to_s.eql? folder.to_s
        folder_str = " (folder=#{folder})"
      end
      UI.command_output "############### #{key} #{folder_str}"
      if !File.exists? "./#{folder_str}"
        UI.important "  > folder is missing"
      else
        Dir.chdir("./#{folder}") do
          res = ''
          begin
            Fastlane::Actions::EnsureGitStatusCleanAction.run({})
          rescue StandardError => e
            UI.important "  >> failed to check git status << #{e.message}"
            unless res == ''
              UI.important "  >> #{res}"
            end
            if params[:sunny_verbose]
              UI.user_error! "#{e.backtrace}"
            end
          end
        end
      end
    end
  end
end