Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

process terraform.tfvars file with erb, change default processing strategy back to pass #159

Merged
merged 1 commit into from
Nov 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/terraspace/compiler/strategy/mod.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def strategy_class(path)
return Mod::Pass if ext.empty? # infinite loop without this
return Mod::Pass if Terraspace.pass_file?(path) or !text_file?(path)
# Fallback to Mod::Tf for all other files. ERB useful for terraform.tfvars
"Terraspace::Compiler::Strategy::Mod::#{ext.camelize}".constantize rescue Mod::Tf
"Terraspace::Compiler::Strategy::Mod::#{ext.camelize}".constantize rescue Mod::Pass
end

# Thanks: https://stackoverflow.com/questions/2355866/ruby-how-to-determine-if-file-being-read-is-binary-or-text
Expand Down
4 changes: 4 additions & 0 deletions lib/terraspace/compiler/strategy/mod/tfvars.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
class Terraspace::Compiler::Strategy::Mod
class Tfvars < Tf
end
end