From d6fa0f0a266da2287a00d98307c66f7657dd4170 Mon Sep 17 00:00:00 2001 From: David McFarland Date: Fri, 23 Jun 2023 15:17:33 -0300 Subject: [PATCH] buildDotnetModule: use tmp file for fetch-deps output --- pkgs/build-support/dotnet/build-dotnet-module/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/dotnet/build-dotnet-module/default.nix b/pkgs/build-support/dotnet/build-dotnet-module/default.nix index 16e27188671f..4324f24eb7fb 100644 --- a/pkgs/build-support/dotnet/build-dotnet-module/default.nix +++ b/pkgs/build-support/dotnet/build-dotnet-module/default.nix @@ -287,13 +287,15 @@ stdenvNoCC.mkDerivation (args // { echo "Succesfully restored project" echo "Writing lockfile..." - echo -e "# This file was automatically generated by passthru.fetch-deps.\n# Please dont edit it manually, your changes might get overwritten!\n" > "$depsFile" excluded_sources="${lib.concatStringsSep " " sdkDeps}" for excluded_source in ''${excluded_sources[@]}; do ls "$excluded_source" >> "$tmp/excluded_list" done - nuget-to-nix "$tmp/nuget_pkgs" "$tmp/excluded_list" >> "$depsFile" + tmpFile="$tmp"/deps.nix + echo -e "# This file was automatically generated by passthru.fetch-deps.\n# Please dont edit it manually, your changes might get overwritten!\n" > "$tmpFile" + nuget-to-nix "$tmp/nuget_pkgs" "$tmp/excluded_list" >> "$tmpFile" + mv "$tmpFile" "$depsFile" echo "Succesfully wrote lockfile to $depsFile" ''; } // args.passthru or { };