Created
March 21, 2018 08:41
-
-
Save dockimbel/1c0f51e3044f23688aae696a28d3096b to your computer and use it in GitHub Desktop.
Red source files header updater
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Red [] | |
dive: function [path action [block!] filter [block!]][ | |
bind action 'path | |
if filter [bind filter 'path] | |
foreach file read path [ | |
if dir? file [dive append copy path file action filter] | |
if any [not filter do filter][do action] | |
] | |
] | |
action: [ | |
p: append copy path file | |
data: read/binary p | |
foreach rights [ | |
"Nenad Rakocevic. All rights reserved." | |
"Qingtian Xie. All rights reserved." | |
][ | |
if pos: find data rights [ | |
change/part pos "Red Foundation" find pos dot | |
either pos/-6 = #"-" [ | |
pos/-2: #"8" | |
][ | |
insert skip pos -1 "-2018" | |
] | |
write/binary p data | |
] | |
] | |
] | |
dive %./ action [ | |
all [ | |
file <> %walk-files.red | |
find [%.red %.r %.reds] suffix? file | |
] | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment