X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=scripts%2Fcheck-unicode.sh;h=10b2a31720ef9db2b48998c4e918f876872421f2;hb=90d5ddea8c75e26a3b2aaad0f53753c11c7cf19c;hp=db45f6ac698c6dab2dd95e061f99342aebb8fdae;hpb=321644b009b33a7f3729574e205ba296256ffbdf;p=releng%2Fbuilder.git diff --git a/scripts/check-unicode.sh b/scripts/check-unicode.sh index db45f6ac6..10b2a3172 100755 --- a/scripts/check-unicode.sh +++ b/scripts/check-unicode.sh @@ -1,6 +1,5 @@ #!/bin/bash - -# @License EPL-1.0 +# SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2015 The Linux Foundation and others. # @@ -13,17 +12,12 @@ # Thanh Ha (The Linux Foundation) - Initial implementation ############################################################################## -directory="." -if [ ! -z "$1" ]; then - directory="$1" -fi +directory=${1:-"."} echo "Scanning $directory" -for x in $(find $directory -type f); do - if LC_ALL=C grep -q '[^[:print:][:space:]]' "$x"; then - echo "file "$x" contains non-ascii characters" - exit 1 - fi -done +if LC_ALL=C grep -r '[^[:print:][:space:]]' "$directory"; then + echo "Found files containing non-ascii characters." + exit 1 +fi echo "All files are ASCII only"