diff --git a/scripts/validate-license.sh b/scripts/validate-license.sh index 12c76f75c105b2a9b935169a0b906c1474633e10..c4f02ba3e271a870c2ec0bcf93c65a6695b30529 100755 --- a/scripts/validate-license.sh +++ b/scripts/validate-license.sh @@ -27,7 +27,7 @@ find_files() { \( -name '*.go' -o -name '*.sh' -o -name 'Dockerfile' \) } -failed_license_header=($(find_files | xargs grep -L 'Licensed under the Apache License, Version 2.0 (the "License");')) +failed_license_header=($(grep -L 'Licensed under the Apache License, Version 2.0 (the "License");' $(find_files))) || : if (( ${#failed_license_header[@]} > 0 )); then echo "Some source files are missing license headers." for f in "${failed_license_header[@]}"; do @@ -36,7 +36,7 @@ if (( ${#failed_license_header[@]} > 0 )); then exit 1 fi -failed_copyright_header=($(find_files | xargs grep -L 'Copyright The Helm Authors.')) +failed_copyright_header=($(grep -L 'Copyright The Helm Authors.' $(find_files))) || : if (( ${#failed_copyright_header[@]} > 0 )); then echo "Some source files are missing the copyright header." for f in "${failed_copyright_header[@]}"; do