Class: Dotcodegen::Init
- Inherits:
-
Object
- Object
- Dotcodegen::Init
- Defined in:
- lib/dotcodegen/init.rb
Class Method Summary collapse
-
.run ⇒ Object
rubocop:disable Metrics/MethodLength.
Class Method Details
.run ⇒ Object
rubocop:disable Metrics/MethodLength
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/dotcodegen/init.rb', line 6 def self.run source_dir = File.('../../config/default/.codegen', __dir__) destination_dir = File.('.codegen', Dir.pwd) FileUtils.mkdir_p(destination_dir) unless Dir.exist?(destination_dir) FileUtils.cp_r("#{source_dir}/.", destination_dir) instructions_dir = File.('instructions', destination_dir) FileUtils.mkdir_p(instructions_dir) unless Dir.exist?(instructions_dir) Dir.glob("#{source_dir}/instructions/*.md").each do |md_file| FileUtils.cp(md_file, instructions_dir) end puts 'Codegen initialized.' exit end |