Skip to content

Commit

Permalink
Fallback to System.Environment.SpecialFolder.LocalApplicationData - r…
Browse files Browse the repository at this point in the history
…eferences #1863
  • Loading branch information
forki committed Aug 22, 2016
1 parent 12b5275 commit 6d41f9d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Paket.Core/Constants.fs
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,20 @@ let AppDataFolder = Environment.GetFolderPath(Environment.SpecialFolder.Ap
let PaketConfigFolder = Path.Combine(AppDataFolder, "Paket")
let PaketConfigFile = Path.Combine(PaketConfigFolder, "paket.config")

let UserProfile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)
let GitRepoCacheFolder = Path.Combine(UserProfile,".paket","git","db")
let LocalRootForTempData =
let userProfile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)
if String.IsNullOrWhiteSpace userProfile then
Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData)
else
userProfile

let GitRepoCacheFolder = Path.Combine(LocalRootForTempData,".paket","git","db")

let [<Literal>] GlobalPackagesFolderEnvironmentKey = "NUGET_PACKAGES"
let UserNuGetPackagesFolder =
let path = Environment.GetEnvironmentVariable(GlobalPackagesFolderEnvironmentKey)
if String.IsNullOrEmpty path then
Path.Combine(UserProfile,".nuget","packages")
Path.Combine(LocalRootForTempData,".nuget","packages")
else
path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar)

Expand Down

0 comments on commit 6d41f9d

Please sign in to comment.