Module: LonoCfn::Util

Included in:
Base, Delete
Defined in:
lib/lono_cfn/util.rb

Instance Method Summary collapse

Instance Method Details

#are_you_sure?(action) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/lono_cfn/util.rb', line 3

def are_you_sure?(action)
  if @options[:sure]
    sure = 'y'
  else
    puts "Are you sure you want to want to #{action} the stack with the changes? (y/N)"
    sure = $stdin.gets
  end

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