Merge pull request #295812 from UlyssesZh/fix-nuget-to-nix-trailing-slash

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

authored by Weijia Wang and committed by GitHub 7b100058 f01fc7f1

+5 -1
+5 -1
pkgs/build-support/dotnet/nuget-to-nix/nuget-to-nix.sh
··· 33 34 remote_sources+=($index) 35 36 - base_addresses[$index]=$( 37 curl --compressed --netrc -fsL "$index" | \ 38 jq -r '.resources[] | select(."@type" == "PackageBaseAddress/3.0.0")."@id"') 39 done 40 41 echo "{ fetchNuGet }: ["
··· 33 34 remote_sources+=($index) 35 36 + base_address=$( 37 curl --compressed --netrc -fsL "$index" | \ 38 jq -r '.resources[] | select(."@type" == "PackageBaseAddress/3.0.0")."@id"') 39 + if [[ ! "$base_address" == */ ]]; then 40 + base_address="$base_address/" 41 + fi 42 + base_addresses[$index]="$base_address" 43 done 44 45 echo "{ fetchNuGet }: ["