Update cargo-about to 0.6.6 and remove workaround to fail on warning (#25209)

See https://github.com/EmbarkStudios/cargo-about/issues/274

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-02-19 17:26:53 -07:00 committed by GitHub
parent 121aba7106
commit 1087e05da4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 21 deletions

View file

@ -2,7 +2,7 @@
set -euo pipefail
CARGO_ABOUT_VERSION="0.6.1"
CARGO_ABOUT_VERSION="0.6.6"
OUTPUT_FILE="${1:-$(pwd)/assets/licenses.md}"
TEMPLATE_FILE="script/licenses/template.md.hbs"
@ -25,19 +25,10 @@ fi
echo "Generating cargo licenses"
stderr_file=$(mktemp)
cargo about generate \
--fail \
-c script/licenses/zed-licenses.toml \
"${TEMPLATE_FILE}" \
2> >(tee "$stderr_file") \
>> $OUTPUT_FILE
if cat "$stderr_file" | grep -v "\[WARN\]" > /dev/null; then
echo "Error: License check failed - warnings found" >&2
exit 1
fi
"${TEMPLATE_FILE}" >> $OUTPUT_FILE
sed -i.bak 's/"/"/g' $OUTPUT_FILE
sed -i.bak 's/'/'\''/g' $OUTPUT_FILE # The ` '\'' ` thing ends the string, appends a single quote, and re-opens the string

View file

@ -2,7 +2,7 @@
set -euo pipefail
CARGO_ABOUT_VERSION="0.6.1"
CARGO_ABOUT_VERSION="0.6.6"
OUTPUT_FILE="${1:-$(pwd)/assets/licenses.csv}"
TEMPLATE_FILE="script/licenses/template.csv.hbs"
@ -15,20 +15,11 @@ fi
echo "Generating cargo licenses"
stderr_file=$(mktemp)
cargo about generate \
--fail \
-c script/licenses/zed-licenses.toml \
script/licenses/template.csv.hbs \
2> >(tee "$stderr_file") \
| awk 'NR==1{print;next} NF{print | "sort"}' \
> $OUTPUT_FILE
# Check that there are no warnings.
if echo "$about_stderr" | grep -v "\[WARN\]" > /dev/null; then
echo "Error: License check failed - warnings found" >&2
exit 1
fi
echo "generate-licenses-csv completed. See $OUTPUT_FILE"