Sha256: 8a5e16c2dfc6953e703155df8efba47090f8b2b3720652043e5cb24312763a3d

Contents?: true

Size: 474 Bytes

Versions: 6

Compression:

Stored size: 474 Bytes

Contents

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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lono-3.0.1 lib/lono/cfn/util.rb
lono-3.0.0 lib/lono/cfn/util.rb
lono-2.1.0 lib/lono/cfn/util.rb
lono-2.0.5 lib/lono/cfn/util.rb
lono-2.0.4 lib/lono/cfn/util.rb
lono-2.0.3 lib/lono/cfn/util.rb