lib/terragov/buildpaths.rb in terragov-0.3.3 vs lib/terragov/buildpaths.rb in terragov-0.4.0
- old
+ new
@@ -46,15 +46,11 @@
secret_project_data: secret_project_data
}
end
def data_validation(path)
- if File.exist?(path)
- true
- else
- false
- end
+ File.exist?(path)
end
def data_paths(options = {})
# The path order is important for passing the var files in the correct
# order to Terraform as that creates the hierarchy for overrides
@@ -84,11 +80,11 @@
else
puts 'Files checked: '
paths.each do |path|
puts path
end
- return false
+ false
end
end
def build_command(options = {})
paths = base(options)
@@ -99,10 +95,9 @@
abort("Error: cannot find any var files") unless check_var_files(var_paths)
$full_vars = []
data_paths(options).each do |path|
if data_validation(path)
- # TODO: write sops class
if path == paths[:secret_project_data] || path == paths[:secret_common_project_data]
$full_vars << "-var-file <(sops -d #{path})"
else
$full_vars << "-var-file #{path}"
end