Sha256: 8b01411ea4e32d913431da039a5123624541a1a22aa1a81e50f562ff814198ca

Contents?: true

Size: 563 Bytes

Versions: 5

Compression:

Stored size: 563 Bytes

Contents

module Lono::Cfn::Util
  def are_you_sure?(stack_name, action)
    if @options[:sure]
      sure = 'y'
    else
      message = case action
      when :update
        "Are you sure you want to want to update the #{stack_name.colorize(:green)} stack with the changes? (y/N)"
      when :delete
        "Are you sure you want to want to delete the #{stack_name.colorize(:green)} stack? (y/N)"
      end
      puts message
      sure = $stdin.gets
    end

    unless sure =~ /^y/
      puts "Whew! Exiting without running #{action}."
      exit 0
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lono-4.2.4 lib/lono/cfn/util.rb
lono-4.2.3 lib/lono/cfn/util.rb
lono-4.2.2 lib/lono/cfn/util.rb
lono-4.2.1 lib/lono/cfn/util.rb
lono-4.2.0 lib/lono/cfn/util.rb