lib/terraspace/compiler/dirs_concern.rb in terraspace-1.0.6 vs lib/terraspace/compiler/dirs_concern.rb in terraspace-1.1.0

- old
+ new

@@ -35,11 +35,16 @@ # Examples: # type_dir stacks # path /home/ec2-user/environment/downloads/infra/app/stacks/demo def select_stack?(type_dir, path) return true unless type_dir == "stacks" - select = Terraspace::Compiler::Select.new(path) + stack_name = extract_stack_name(path) + select = Terraspace::Compiler::Select.new(stack_name) select.selected? + end + + def extract_stack_name(path) + path.sub(%r{.*(app|vendor)/stacks/}, '') end def local_paths(type_dir) dirs("app/#{type_dir}/*") + dirs("vendor/#{type_dir}/*") end