class Logchange::Initialize

Creates the changes directory if it doesn't exist, and logs the initialization.

Public Instance Methods

execute() click to toggle source
# File lib/logchange/initialize.rb, line 6
def execute
  path = File.join(Logchange.configuration.changelog_directory_path, 'unreleased')

  if File.directory?(path)
    puts 'The changelog directory already exists. Cancelling.'
  else
    FileUtils.mkdir_p(path)
    Logchange::Logger.new('Added logchange to project.').execute
  end
end