From dab69be922ebc4ded7d478a60bef5c99a8dacdb6 Mon Sep 17 00:00:00 2001 From: Tung Nguyen Date: Wed, 7 Jun 2023 21:21:32 +0000 Subject: [PATCH] erb processing for rb files in modules folder for dsl related #301 --- lib/terraspace/compiler/strategy/mod.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/terraspace/compiler/strategy/mod.rb b/lib/terraspace/compiler/strategy/mod.rb index a763180b..42f9955b 100644 --- a/lib/terraspace/compiler/strategy/mod.rb +++ b/lib/terraspace/compiler/strategy/mod.rb @@ -10,7 +10,7 @@ def run def strategy_class(path) # Significant speed improvement - return Mod::Pass if copy_modules? + return Mod::Pass if copy_modules?(path) ext = File.extname(path).sub('.','') return Mod::Pass if ext.empty? # infinite loop without this @@ -20,7 +20,8 @@ def strategy_class(path) end @@copy_modules_warned = false - def copy_modules? + def copy_modules?(path) + return false if path.include?("/modules/") && path.ends_with?(".rb") # For DSL return false unless @options[:type_dir] == "modules" copy_modules = Terraspace.config.build.copy_modules