Method: HttpdConfigmapGenerator::Base::FileHelper#delete_target_file

Defined in:
lib/httpd_configmap_generator/base/file_helper.rb

#delete_target_file(file_path) ⇒ Object



21
22
23
24
25
26
27
28
29
30
# File 'lib/httpd_configmap_generator/base/file_helper.rb', line 21

def delete_target_file(file_path)
  if File.exist?(file_path)
    if opts[:force]
      info_msg("File #{file_path} exists, forcing a delete")
      File.delete(file_path)
    else
      raise "File #{file_path} already exist"
    end
  end
end