Skip to content

Commit

Permalink
chore(rust): allow the make notice_file_update task to run on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
etorreborre committed Jan 22, 2025
1 parent 7560ee1 commit 067a877
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tools/scripts/release/parseCrates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ INPUT=$(jq "." $1)
# "adler 1.0.2 registry+https://github.com/rust-lang/crates.io-index"
regex="(.*) [0-9]+\.[0-9]+\.[0-9]+ \(*(.*)\+(.*)"

declare -A crates
crates=()

while IFS= read -r key; do
if [[ $key =~ $regex ]]; then
Expand All @@ -28,11 +28,14 @@ while IFS= read -r key; do
url=${BASH_REMATCH[3]}
license=$(jq --arg key "$key" --raw-output '.[$key].licenses | join(", ")' <<<$INPUT)

if [[ ! -z ${crates[$crate_name]} ]]; then
continue
fi
for crate in "${crates[@]}"; do
if [[ "$crate" == "$crate_name" ]]; then
continue
fi
done

crates[$crate_name]='true'
# Add crate_name to the list of processed crates
crates+=("$crate_name")

# Strip URL of trailing )
url="${url//\)/}"
Expand Down

0 comments on commit 067a877

Please sign in to comment.