diff --git a/flake.nix b/flake.nix index 8ec5705..5accef8 100644 --- a/flake.nix +++ b/flake.nix @@ -64,7 +64,6 @@ packages = [ just nuget-to-json - azure-artifacts-credprovider ( with dotnetCorePackages; combinePackages [ diff --git a/nuget-to-json b/nuget-to-json index e255952..4b01cbd 100755 --- a/nuget-to-json +++ b/nuget-to-json @@ -61,7 +61,6 @@ done [[ -d "$package" ]] || continue cd "$package" for version in *; do - id=$(xmlstarlet sel -t -v /_:package/_:metadata/_:id "$version"/*.nuspec) if grep -qxF "$id.$version.nupkg" "$excluded_list"; then @@ -71,7 +70,6 @@ done # packages in the nix store should have an empty metadata file # packages installed with 'dotnet tool' may be missing 'source' used_source="$(jq -r 'if has("source") then .source elif has("contentHash") then "__unknown" else "" end' "$version"/.nupkg.metadata)" - found=false if [[ -z "$used_source" || -d "$used_source" ]]; then @@ -79,13 +77,15 @@ done fi for source in "${remote_sources[@]}"; do - url="${base_addresses[$source]}$package/$version/$package.$version.nupkg" - if [[ "$source" == "$used_source" ]]; then hash="$(nix-hash --type sha256 --flat --sri "$version/$package.$version".nupkg)" found=true break + else + # do nothing if the package does not already exist + # locally, since nix-prefetch-url does not handle authentication + : fi done