Skip to content

Commit

Permalink
FAB-3675 add gotools/build and fix
Browse files Browse the repository at this point in the history
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 <chrisfer@us.ibm.com>
  • Loading branch information
christo4ferris committed May 6, 2017
1 parent 2e479a7 commit dc9c88f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions scripts/check_license.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/bin/bash

echo "Checking Go files for license headers ..."
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"`
if [ $? -eq 0 ]; then
echo "The following files are missing license headers:"
echo "$missing"
exit 1
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"`
if [ -z "$missing" ]; then
echo "All go files have license headers"
exit 0
fi
echo "All go files have license headers"
echo "The following files are missing license headers:"
echo "$missing"
exit 1

0 comments on commit dc9c88f

Please sign in to comment.