Method: Committer::Config::Writer#write_config_file

Defined in:
lib/committer/config/writer.rb

#write_config_file(file_path, contents) ⇒ Object



25
26
27
28
29
30
31
32
33
34
# File 'lib/committer/config/writer.rb', line 25

def write_config_file(file_path, contents)
  FileUtils.mkdir_p(@config_dir)
  if File.exist?(file_path)
    puts "Config file already exists at #{config_file}, skipping write"
    false
  else
    File.write(file_path, contents)
    true
  end
end