Method: TFW.write_stack_file

Defined in:
lib/tfw.rb

.write_stack_file(stack_file, stack) ⇒ Object



91
92
93
94
95
96
97
98
99
100
# File 'lib/tfw.rb', line 91

def write_stack_file(stack_file, stack)
  [stack_file, "#{stack_file}.json"].each { |f| FileUtils.rm_f f }

  if as_json?
    stack_file = "#{stack_file}.json"
    File.write stack_file, pretty_json(AwsSgWorkaround.fix(stack.to_json))
  else
    File.write stack_file, stack
  end
end