From 89470414179a5374ec3184e6a2ee7146ab5abe3f Mon Sep 17 00:00:00 2001 From: mars Date: Sat, 26 Nov 2022 22:14:48 -0700 Subject: [PATCH] Revert "Fix check_licenses.sh tomcat error failure" This reverts commit b1b7d1d4e76ab3d1c908be0eef02bb34d5f158d8. --- check_licenses.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/check_licenses.sh b/check_licenses.sh index 9dc761d..aad8cd3 100755 --- a/check_licenses.sh +++ b/check_licenses.sh @@ -12,17 +12,16 @@ dir="$(pwd | sed 's/\//\n/g' | tail -n 1)" for toml in $(find "$PWD" -name "Cargo.toml"); do printf "Project: %s\n" "$(tomcat package.name "$toml")" - - if [ "$(toml_lic="$(tomcat package.license "$toml" && printf "%s\n" "$?")")" = "0" ]; then - printf "%s: Missing license information\n" "$(printf "%s\n" "$toml" |\ - sed "s/^.\+$dir\///g")" - continue - fi - for file in $(find "$(printf "%s\n" "$toml" |\ sed 's/Cargo\.toml/src/g')" -name "*.rs") do info="$(head -n 2 "$file")" + toml_lic="$(tomcat package.license "$toml")" + if ! test -n "$toml_lic"; then + printf "%s: Missing license information\n" "$(printf "%s\n" "$toml" |\ + sed "s/^.\+$dir\///g")" + continue 2 + fi if ! [ "$toml_lic" = "$(printf "%s\n" "$info" | tail -n 1 |\ sed -n 's/\/\/ SPDX-License-Identifier: //p')" ] then