diff --git a/lib/generamba/cli/setup_command.rb b/lib/generamba/cli/setup_command.rb index 23ab4b5..c9a05bb 100644 --- a/lib/generamba/cli/setup_command.rb +++ b/lib/generamba/cli/setup_command.rb @@ -70,6 +70,15 @@ def setup 'Cartfile') end + should_add_templates = yes?('Do you want to add some well known templates to the Rambafile? (yes/no)') + if should_add_templates + properties[TEMPLATES_KEY] = [ + '{name: rviper_controller}', + '{name: mvvm_controller}', + '{name: swifty_viper}' + ] + end + properties[PROJECT_TARGET_KEY] = project_target.name properties[PROJECT_FILE_PATH_KEY] = project_file_path properties[PROJECT_GROUP_PATH_KEY] = project_group_path @@ -88,11 +97,16 @@ def setup PrintTable.print_values( values: properties, - title: "Summary for generamba setup" + title: 'Summary for generamba setup' ) Generamba::RambafileGenerator.create_rambafile(properties) - puts('Rambafile successfully created! Now add some templates to the Rambafile and run `generamba template install`.'.green) + if should_add_templates + puts('Rambafile successfully created! Now run `generamba template install`.'.green) + else + puts('Rambafile successfully created!\n Go on and find some templates in our catalog using `generamba template list` command.\n Add any of them to the Rambafile and run `generamba template install`.'.green) + end + end end end \ No newline at end of file diff --git a/lib/generamba/code_generation/Rambafile.liquid b/lib/generamba/code_generation/Rambafile.liquid index b223e90..8ae0c42 100644 --- a/lib/generamba/code_generation/Rambafile.liquid +++ b/lib/generamba/code_generation/Rambafile.liquid @@ -33,6 +33,8 @@ test_group_path: {{ test_group_path }}{% endif %} ### Templates templates: -#- {name: local_template_name, local: 'absolute/file/path'} +{% if templates.size > 0 %}{% for item in templates %}- {{ item }} +{% endfor %}{% else %}#- {name: local_template_name, local: 'absolute/file/path'} #- {name: remote_template_name, git: 'https://github.com/igrekde/remote_template'} -#- {name: catalog_template_name} \ No newline at end of file +#- {name: catalog_template_name} +{% endif %} \ No newline at end of file