Class: Terraspace::CLI::New::Hook
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Terraspace::CLI::New::Hook
- Includes:
- Thor::Actions
- Defined in:
- lib/terraspace/cli/new/hook.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.options ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/terraspace/cli/new/hook.rb', line 7 def self. [ [:force, aliases: %w[y], type: :boolean, desc: "Bypass overwrite are you sure prompt for existing files"], [:kind, default: "terraform", desc: "terraform or terraspace"], [:name, desc: "Command name. Defaults to apply for terraform kind and build for terraspace kind"], [:type, default: "project", desc: "project, stack or module"], ] end |
.source_root ⇒ Object
17 18 19 |
# File 'lib/terraspace/cli/new/hook.rb', line 17 def self.source_root File.("../../../templates/base/hook", __dir__) end |
Instance Method Details
#check_stack_arg ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/terraspace/cli/new/hook.rb', line 54 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 hook STACK --type #{type} EOL exit 1 end |
#create ⇒ Object
66 67 68 |
# File 'lib/terraspace/cli/new/hook.rb', line 66 def create directory ".", dest end |