Skip to content

Commit

Permalink
Merge pull request #311 from boltops-tools/dont-copy-modules-for-rb-f…
Browse files Browse the repository at this point in the history
…iles

erb processing for rb files in modules folder for dsl
  • Loading branch information
tongueroo authored Jun 7, 2023
2 parents c89cff5 + dab69be commit 03f157b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/terraspace/compiler/strategy/mod.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 03f157b

Please # to comment.