Fix skeleton file creation

This commit is contained in:
Dani Martin
2021-12-17 13:18:19 +01:00
committed by GitHub
parent 3806f7ebe3
commit 202721e561
+1 -1
View File
@@ -134,7 +134,7 @@ class CMockGenerator
def create_skeleton_source_file(mock_project)
filename = "#{@config.mock_path}/#{@subdir + '/' if @subdir}#{mock_project[:module_name]}.c"
existing = File.exist?(filename) ? File.read(filename) : ''
@file_writer.append_file(mock_project[:module_name] + '.c', @subdir) do |file, fullname|
@file_writer.create_file(mock_project[:module_name] + '.c', @subdir) do |file, fullname|
blank_project = mock_project.clone
blank_project[:parsed_stuff] = { :functions => [] }
create_source_header_section(file, fullname, blank_project) if existing.empty?