Skip to content

Commit dc9c88f

Browse files
FAB-3675 add gotools/build and fix
Murali caught that gotools/build tree wasn't excluded. However, it also highlighted a bug in the grep, so refactored. Change-Id: Ie0afa5151a1e48fdfa333e883077287c19bcda4b Signed-off-by: Christopher Ferris <[email protected]>
1 parent 2e479a7 commit dc9c88f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

scripts/check_license.sh

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/bin/bash
22

33
echo "Checking Go files for license headers ..."
4-
missing=`grep -l -L "Apache License" \`find . -name "*.go"\` | grep -v "./vendor" | grep -v "build/docker/gotools" | grep -v ".pb.go" | grep -v "examples/chaincode/go/utxo/consensus/consensus.go"`
5-
if [ $? -eq 0 ]; then
6-
echo "The following files are missing license headers:"
7-
echo "$missing"
8-
exit 1
4+
missing=`find . -name "*.go" | grep -v build/ | grep -v vendor/ | grep -v ".pb.go" | grep -v "examples/chaincode/go/utxo/consensus/consensus.go" | xargs grep -l -L "Apache License"`
5+
if [ -z "$missing" ]; then
6+
echo "All go files have license headers"
7+
exit 0
98
fi
10-
echo "All go files have license headers"
9+
echo "The following files are missing license headers:"
10+
echo "$missing"
11+
exit 1

0 commit comments

Comments
 (0)