Class: Terraspace::CLI::New::Arg
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Terraspace::CLI::New::Arg
- Includes:
- Thor::Actions
- Defined in:
- lib/terraspace/cli/new/arg.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.options ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/terraspace/cli/new/arg.rb', line 7 def self. [ [:force, aliases: %w[y], type: :boolean, desc: "Bypass overwrite are you sure prompt for existing files"], [:name, default: "apply", desc: "command name"], [:type, default: "project", desc: "project, stack or module"], ] end |
.source_root ⇒ Object
16 17 18 |
# File 'lib/terraspace/cli/new/arg.rb', line 16 def self.source_root File.("../../../templates/base/arg", __dir__) end |
Instance Method Details
#check_stack_arg ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/terraspace/cli/new/arg.rb', line 46 def check_stack_arg return if type == "project" return unless stack.nil? # Else check for STACK argument for type module or stack puts <<~EOL Required STACK argument, either the module or stack name. Usage: terraspace new arg STACK --type #{type} EOL exit 1 end |
#create ⇒ Object
58 59 60 |
# File 'lib/terraspace/cli/new/arg.rb', line 58 def create directory ".", dest end |