mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-04 04:49:08 +08:00
fda8d62b38
Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
31 lines
711 B
Bash
Executable File
31 lines
711 B
Bash
Executable File
LICENSE=$1
|
|
FOLDER=$2
|
|
|
|
if [ -z ${FOLDER} ] || [ -z ${LICENSE} ]; then
|
|
echo "usage $0 <path/to/license> <path/to/code_folder>"
|
|
exit
|
|
fi
|
|
|
|
cat ${LICENSE} > /dev/null || exit -1
|
|
|
|
FILES=`find ${FOLDER} \
|
|
| grep -E "(*\.cpp$|*\.h$|*\.cu$)" \
|
|
| grep -v thirdparty \
|
|
| grep -v cmake_build \
|
|
| grep -v cmake-build \
|
|
| grep -v output \
|
|
| grep -v "\.pb\."`
|
|
# echo formating ${FILES} ...
|
|
skip_count=0
|
|
for f in ${FILES}; do
|
|
if (grep "Apache License" $f > /dev/null);then
|
|
# echo "No need to copy the License Header to $f"
|
|
skip_count=$((skip_count+1))
|
|
else
|
|
cat ${LICENSE} $f > $f.new
|
|
mv $f.new $f
|
|
echo "License Header copied to $f"
|
|
fi
|
|
done
|
|
echo "license adder: $skip_count file(s) skiped"
|