Skip to content
Browse files

fix generate_command rake task

  • Loading branch information...
1 parent bea4cbe commit 6806dd6ce84a600ae40c4a2d560ccdbbc3d7ce5c @marcisme marcisme committed
Showing with 8 additions and 3 deletions.
  1. +8 −3 Rakefile
View
11 Rakefile
@@ -49,12 +49,17 @@ task :generate_command do
Dir.glob("src/*.pro").each do |project_file_name|
project = IO.read(project_file_name)
- project.gsub!(/^(HEADERS = .*)/, "\\1 #{name}.h")
- project.gsub!(/^(SOURCES = .*)/, "\\1 #{name}.cpp")
+ project.gsub!(/^(HEADERS = .*)/, "\\1\n #{name}.h \\")
+ project.gsub!(/^(SOURCES = .*)/, "\\1\n #{name}.cpp \\")
File.open(project_file_name, "w") { |file| file.write(project) }
end
File.open("src/find_command.h", "a") do |file|
- file.write("CHECK_COMMAND(#{name})")
+ file.write("CHECK_COMMAND(#{name})\n")
end
+
+ command_factory_file_name = "src/CommandFactory.cpp"
+ command_factory = IO.read(command_factory_file_name)
+ command_factory.sub!(/^$/, "#include \"#{name}.h\"\n")
+ File.open(command_factory_file_name, "w") { |file| file.write(command_factory) }
end

0 comments on commit 6806dd6

Please sign in to comment.
Something went wrong with that request. Please try again.