forked from Azure/azure-sdk-for-net
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlicense_checker.sh
More file actions
21 lines (17 loc) · 785 Bytes
/
Copy pathlicense_checker.sh
File metadata and controls
21 lines (17 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
set -e
base=`dirname {BASH_SOURCE[0]}`
rootdir="$( cd "$base" && pwd )"
echo Scanning *.cs files for missing License header EXCEPT batch folder in $rootdir
badFiles=()
# Once Batch folder will be converter to MIT license uncomment the following line and remove the next read
#read -ra badFiles <<< $(find $rootdir -name '*.cs' -print | xargs grep -iL "// Licensed under the MIT License. See License.txt in the project root")
read -ra badFiles <<< $(find $rootdir -path "$rootdir/src/Batch" -prune -o -name '*.cs' -print | xargs grep -iL "// Licensed under the MIT License. See License.txt in the project root")
if [ -n "$badFiles" ]; then
echo Setting build as FAILED...
for s in "${badFiles[@]}"; do
echo "License header missing in: $s"
done
exit -1
fi
exit 0