@@ -60,7 +60,7 @@ public BuildScript Analyse(IAutobuilder<AutobuildOptionsShared> builder, bool au
6060 // Use `nuget.exe` from source code repo, if present, otherwise first attempt with global
6161 // `nuget` command, and if that fails, attempt to download `nuget.exe` from nuget.org
6262 var nuget = builder . GetFilename ( "nuget.exe" ) . Select ( t => t . Item1 ) . FirstOrDefault ( ) ?? "nuget" ;
63- var nugetDownload = builder . Actions . PathCombine ( builder . Options . RootDirectory , ".nuget" , "nuget.exe" ) ;
63+ var nugetDownloadPath = builder . Actions . PathCombine ( FileUtils . GetTemporaryWorkingDirectory ( builder . Actions . GetEnvironmentVariable , builder . Options . Language . UpperCaseName , out var _ ) , ".nuget" , "nuget.exe" ) ;
6464 var nugetDownloaded = false ;
6565
6666 var ret = BuildScript . Success ;
@@ -96,13 +96,13 @@ BuildScript GetNugetRestoreScript() =>
9696 // If `nuget restore` fails, and we have not already attempted to download `nuget.exe`,
9797 // download it and reattempt `nuget restore`.
9898 var nugetDownloadAndRestore =
99- BuildScript . Bind ( DownloadNugetExe ( builder , nugetDownload ) , exitCode =>
99+ BuildScript . Bind ( DownloadNugetExe ( builder , nugetDownloadPath ) , exitCode =>
100100 {
101101 nugetDownloaded = true ;
102102 if ( exitCode != 0 )
103103 return BuildScript . Failure ;
104104
105- nuget = nugetDownload ;
105+ nuget = nugetDownloadPath ;
106106 return GetNugetRestoreScript ( ) ;
107107 } ) ;
108108 ret &= BuildScript . Try ( nugetRestore | nugetDownloadAndRestore | msbuildRestoreCommand . Script ) ;
0 commit comments