lib/codepipe/init.rb in codepipeline-0.3.3 vs lib/codepipe/init.rb in codepipeline-0.3.4

- old
+ new

@@ -2,18 +2,20 @@ class Init < Sequence # Ugly, this is how I can get the options from to match with this Thor::Group def self.cli_options [ [:name, desc: "CodePipeline project name."], + [:mode, desc: "Modes: light or full"], [:force, type: :boolean, desc: "Bypass overwrite are you sure prompt for existing files."], [:template, desc: "Custom template to use."], [:template_mode, desc: "Template mode: replace or additive."], ] end cli_options.each { |o| class_option(*o) } def setup_template_repo + puts "[DEPRECATION] This gem has been renamed to pipedream and will no longer be supported. Please switch to pipedream as soon as possible." return unless @options[:template]&.include?('/') sync_template_repo end @@ -30,13 +32,23 @@ end end def copy_project puts "Initialize codepipeline project in .codepipeline" + + excludes = %w[.git] + if @options[:mode] == "light" + excludes += %w[ + settings.yml + sns.rb + ] + end + pattern = Regexp.new(excludes.join('|')) + if @options[:template] - directory ".", ".codepipeline", exclude_pattern: /.git/ + directory ".", ".codepipeline", exclude_pattern: pattern else - directory ".", exclude_pattern: /.git/ + directory ".", exclude_pattern: pattern end end private def project_name \ No newline at end of file