Fix licenses #48
|
@ -12,17 +12,16 @@ dir="$(pwd | sed 's/\//\n/g' | tail -n 1)"
|
||||||
|
|
||||||
for toml in $(find "$PWD" -name "Cargo.toml"); do
|
for toml in $(find "$PWD" -name "Cargo.toml"); do
|
||||||
printf "Project: %s\n" "$(tomcat package.name "$toml")"
|
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" |\
|
for file in $(find "$(printf "%s\n" "$toml" |\
|
||||||
sed 's/Cargo\.toml/src/g')" -name "*.rs")
|
sed 's/Cargo\.toml/src/g')" -name "*.rs")
|
||||||
do
|
do
|
||||||
info="$(head -n 2 "$file")"
|
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 |\
|
if ! [ "$toml_lic" = "$(printf "%s\n" "$info" | tail -n 1 |\
|
||||||
sed -n 's/\/\/ SPDX-License-Identifier: //p')" ]
|
sed -n 's/\/\/ SPDX-License-Identifier: //p')" ]
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in New Issue