lib/terraspace/compiler/writer.rb in terraspace-0.6.5 vs lib/terraspace/compiler/writer.rb in terraspace-0.6.6
- old
+ new
@@ -8,12 +8,18 @@
@src_path = options[:src_path]
@dest_name = options[:dest_name] # override generated name
end
def dest_path
- name = @dest_name || @src_path.sub('.rb','.tf.json')
+ name = get_name
name = basename(name)
"#{dest_dir}/#{name}"
+ end
+
+ def get_name
+ return @dest_name if @dest_name
+ return @src_path if Terraspace.pass_file?(@src_path)
+ @src_path.sub('.rb','.tf.json')
end
def dest_dir
if @mod.is_a?(Terraspace::Mod::Remote)
File.dirname(@src_path) # for Mod::Remote src is dest