diff --git a/lib/terraspace/cli/new/project.rb b/lib/terraspace/cli/new/project.rb index 2f70e1c7..e2ddcfb8 100644 --- a/lib/terraspace/cli/new/project.rb +++ b/lib/terraspace/cli/new/project.rb @@ -6,7 +6,6 @@ def self.project_options [:config, type: :boolean, default: true, desc: "Whether or not to generate config files."], [:force, aliases: %w[y], type: :boolean, desc: "Bypass overwrite are you sure prompt for existing files."], [:quiet, type: :boolean, desc: "Quiet output."], - [:test_structure, type: :boolean, desc: "Create project bootstrap test structure."], ] end @@ -60,11 +59,6 @@ def create_starter_stack Stack.start(component_args("demo", name)) end - def create_test - return unless @options[:test_structure] - Test::Bootstrap.start(["--dir", name]) - end - def bundle_install return if @options[:bundle] == false log "=> Installing dependencies with: bundle install" diff --git a/lib/terraspace/cli/new/test.rb b/lib/terraspace/cli/new/test.rb index 21a0435d..c242af50 100644 --- a/lib/terraspace/cli/new/test.rb +++ b/lib/terraspace/cli/new/test.rb @@ -3,13 +3,13 @@ class Test < Thor::Group include Thor::Actions include Terraspace::CLI::New::Helpers - argument :name + argument :name, required: false def self.options [ [:force, aliases: %w[y], type: :boolean, desc: "Bypass overwrite are you sure prompt for existing files"], [:test_name, desc: "Test name. Defaults to the project, module or stack name"], - [:type, default: "project", desc: "project, stack or module"], + [:type, default: "stack", desc: "project, stack or module"], ] end options.each { |args| class_option(*args) } @@ -42,6 +42,10 @@ def test_template_source(template, type) public def create + if type != 'project' && name.nil? + puts "ERROR: require NAME for type stack and module".color(:red) + exit 1 + end test_template_source(@options[:lang], type) puts "=> Creating #{type} test: #{name}" directory ".", dest