nuget-to-nix: fix the bug of wrong url in the generated nix file when the package base address of the nuget source does not have a trailing slash

This commit is contained in:
Ulysses Zhan 2024-03-14 00:29:50 -07:00
parent a0c5842bf6
commit acaf847d4f

View file

@ -33,9 +33,13 @@ for index in "${sources[@]}"; do
remote_sources+=($index)
base_addresses[$index]=$(
base_address=$(
curl --compressed --netrc -fsL "$index" | \
jq -r '.resources[] | select(."@type" == "PackageBaseAddress/3.0.0")."@id"')
if [[ ! "$base_address" == */ ]]; then
base_address="$base_address/"
fi
base_addresses[$index]="$base_address"
done
echo "{ fetchNuGet }: ["