lib/origen/generator/job.rb in origen-0.7.13 vs lib/origen/generator/job.rb in origen-0.7.14

- old
+ new

@@ -57,14 +57,28 @@ def reset_output_pattern_filename @output_pattern_filename = nil end def output_pattern_directory - Origen.file_handler.output_directory + @output_pattern_directory ||= begin + dir = Origen.app.config.pattern_output_directory + if tester.respond_to?(:subdirectory) + dir = File.join(dir, tester.subdirectory) + end + FileUtils.mkdir_p(dir) unless File.exist?(dir) + dir + end end def reference_pattern_directory - Origen.file_handler.reference_directory + @reference_pattern_directory ||= begin + dir = Origen.file_handler.reference_directory + if tester.respond_to?(:subdirectory) + dir = File.join(dir, tester.subdirectory) + end + FileUtils.mkdir_p(dir) unless File.exist?(dir) + dir + end end def output_prefix p = Origen.config.pattern_prefix ? Origen.config.pattern_prefix + '_' : '' p = "_#{p}" if Origen.tester.doc?