Created
February 21, 2021 08:54
-
-
Save g4s8/a6eb27a6e333c7c8ec641eb8ee02822e to your computer and use it in GitHub Desktop.
Script for replacing license headers in all java files
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
#!/bin/bash | |
set -e | |
for j in $(find $PWD -type f -name '*.java'); do | |
sed -i '/^\/\*/{:a;N;/\*\//!ba};/MIT License/d' $j | |
echo "removed old license: $j" | |
rm -f tmp | |
cp $1 tmp | |
cat $j >> tmp | |
rm $j | |
mv tmp $j | |
echo "added new license: $j" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment