Sha256: 8fe261845345d9d439a48a4d0dc8117c7ccda384a03ce8040f225d0d2cab8994

Contents?: true

Size: 834 Bytes

Versions: 1

Compression:

Stored size: 834 Bytes

Contents

require 'fileutils'

module Codelog
  module Command
    class Setup
      include FileUtils

      TEMPLATE_FILE_PATH = File.dirname(__FILE__) + '/../../fixtures/template.yml'

      def self.run
        Codelog::Command::Setup.new.run
      end

      def run
        chdir Dir.pwd do
          # This script provides the initial setup for the gem usage.

          puts '== Creating folder structure and template =='
          system! 'mkdir changelogs/'
          system! 'mkdir changelogs/unreleased'
          system! 'mkdir changelogs/releases'
          system! "cp #{TEMPLATE_FILE_PATH} changelogs/template.yml"
          system! 'touch changelogs/unreleased/.gitkeep'
        end
      end

      private

      def system!(*args)
        system(*args) || abort("\n== Command #{args} failed ==")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
codelog-0.2.2 lib/codelog/command/setup.rb