Sha256: 3f6be05d730580211f517769de49d8c3124762a692d6f25c296528eefb19603b

Contents?: true

Size: 810 Bytes

Versions: 43

Compression:

Stored size: 810 Bytes

Contents

# frozen_string_literal: true

require_relative "includes"
require_relative "../../store/shared_config_with_keyring"

class AwsAssumeRole::Cli::Actions::DeleteProfile < AwsAssumeRole::Cli::Actions::AbstractAction
    CommandSchema = proc do
        required(:profile).value(:filled?)
    end

    def act_on(config)
        prompt_for_option(:name_to_delete, "Name", proc { eql? config.profile }, fmt: config.profile)
        AwsAssumeRole.shared_config.delete_profile config.profile
        out format t("commands.delete.completed"), config.profile
    rescue KeyError, Aws::Errors::NoSuchProfileError
        error format(t("errors.NoSuchProfileError"), config.profile)
        raise
    rescue Aws::Errors::MissingCredentialsError
        error t("errors.MissingCredentialsError")
        raise
    end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
aws_assume_role-1.2.3-universal-freebsd lib/aws_assume_role/cli/actions/delete_profile.rb
aws_assume_role-1.2.3-universal-darwin lib/aws_assume_role/cli/actions/delete_profile.rb
aws_assume_role-1.2.3-universal-linux lib/aws_assume_role/cli/actions/delete_profile.rb
aws_assume_role-1.2.3-universal-openbsd lib/aws_assume_role/cli/actions/delete_profile.rb
aws_assume_role-1.2.3 lib/aws_assume_role/cli/actions/delete_profile.rb
aws_assume_role-1.2.3-linux lib/aws_assume_role/cli/actions/delete_profile.rb
aws_assume_role-1.2.2-universal-darwin lib/aws_assume_role/cli/actions/delete_profile.rb
aws_assume_role-1.2.2-universal-linux lib/aws_assume_role/cli/actions/delete_profile.rb
aws_assume_role-1.2.2-linux lib/aws_assume_role/cli/actions/delete_profile.rb
aws_assume_role-1.2.2-universal-openbsd lib/aws_assume_role/cli/actions/delete_profile.rb
aws_assume_role-1.2.2-universal-freebsd lib/aws_assume_role/cli/actions/delete_profile.rb
aws_assume_role-1.2.2 lib/aws_assume_role/cli/actions/delete_profile.rb
aws_assume_role-1.2.1 lib/aws_assume_role/cli/actions/delete_profile.rb
aws_assume_role-1.2.1-linux lib/aws_assume_role/cli/actions/delete_profile.rb
aws_assume_role-1.2.1-universal-openbsd lib/aws_assume_role/cli/actions/delete_profile.rb
aws_assume_role-1.2.1-universal-darwin lib/aws_assume_role/cli/actions/delete_profile.rb
aws_assume_role-1.2.1-universal-freebsd lib/aws_assume_role/cli/actions/delete_profile.rb
aws_assume_role-1.2.1-universal-linux lib/aws_assume_role/cli/actions/delete_profile.rb
aws_assume_role-1.2.0 lib/aws_assume_role/cli/actions/delete_profile.rb
aws_assume_role-1.2.0-linux lib/aws_assume_role/cli/actions/delete_profile.rb