Skip to content

Commit 6934695

Browse files
committed
[Testing] Use NuGet.Configuration to get the path to the NuGet global packages folder
refs #3853 #4209
1 parent eed370a commit 6934695

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/Paket.Core/Common/Constants.fs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,9 @@ let GitRepoCacheFolder = Path.Combine(LocalRootForTempData,".paket","git","db")
114114
let [<Literal>] GlobalPackagesFolderEnvironmentKey = "NUGET_PACKAGES"
115115

116116
let UserNuGetPackagesFolder =
117-
getEnVar GlobalPackagesFolderEnvironmentKey
118-
|> Option.map (fun path ->
119-
path.Replace (Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar)
120-
) |> Option.defaultWith (fun _ ->
121-
Path.Combine (LocalRootForTempData,".nuget","packages")
122-
)
117+
118+
NuGet.Configuration.Settings.LoadDefaultSettings(null)
119+
|> NuGet.Configuration.SettingsUtility.GetGlobalPackagesFolder
123120

124121
/// The magic unpublished date is 1900-01-01T00:00:00
125122
let MagicUnlistingDate = DateTimeOffset(1900, 1, 1, 0, 0, 0, TimeSpan.FromHours(-8.)).DateTime

0 commit comments

Comments
 (0)