diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-12-19 17:36:09 +0100 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-12-19 17:36:09 +0100 |
commit | 1c53b56871a36fdf58e58ee87ac6b56d4e3355f0 (patch) | |
tree | 1eba5f045a2660a3708b1ec91be838e397cb8335 /tools/fix_headers.rb | |
parent | Bug fixes (diff) | |
download | smolbote-1c53b56871a36fdf58e58ee87ac6b56d4e3355f0.tar.xz |
Changed license from GPL3+ to GPL3
Diffstat (limited to 'tools/fix_headers.rb')
-rwxr-xr-x | tools/fix_headers.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/fix_headers.rb b/tools/fix_headers.rb new file mode 100755 index 0000000..6d23ed6 --- /dev/null +++ b/tools/fix_headers.rb @@ -0,0 +1,18 @@ +#!/usr/bin/ruby + + # for all files + +file_names = Dir.glob("**/*.h") + Dir.glob("**/*.cpp") +new_header = File.read('new_header') +old_header = File.read('old_header') + +file_names.each do |file_name| + text = File.read(file_name) + new_contents = text.gsub(old_header, new_header) + + # To merely print the contents of the file, use: + #puts new_contents + + # To write changes to the file, use: + File.open(file_name, "w") {|file| file.puts new_contents } +end |