Skip to content

Commit

Permalink
Analyze content files with case insensitive setting - relates to #816
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed May 27, 2015
1 parent d57682e commit c64d973
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#### 1.6.1 - 27.05.2015
#### 1.6.2 - 27.05.2015
* Analyze content files with case insensitive setting - https://github.com/fsprojects/Paket/issues/816

#### 1.6.0 - 26.05.2015
Expand Down
17 changes: 10 additions & 7 deletions src/Paket.Core/InstallProcess.fs
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,19 @@ open FSharp.Polyfill
open System.Reflection
open System.Diagnostics

let findPackageFolder root (PackageName name) =
let lowerName = name.ToLower()
let di = DirectoryInfo(Path.Combine(root, Constants.PackagesFolderName))
let direct = DirectoryInfo(Path.Combine(di.FullName, name))
if direct.Exists then direct else
match di.GetDirectories() |> Seq.tryFind (fun subDir -> subDir.FullName.ToLower().EndsWith(lowerName)) with
| Some x -> x
| None -> failwithf "Package directory for package %s was not found." name

let private findPackagesWithContent (root,usedPackages:Map<PackageName,PackageInstallSettings>) =
usedPackages
|> Seq.filter (fun kv -> defaultArg kv.Value.Settings.OmitContent false |> not)
|> Seq.map (fun kv ->
let (PackageName name) = kv.Key
let lowerName = name.ToLower()
let di = DirectoryInfo(Path.Combine(root, Constants.PackagesFolderName))
match di.GetDirectories() |> Seq.tryFind (fun subDir -> subDir.FullName.ToLower().EndsWith(lowerName)) with
| Some x -> x
| None -> failwithf "Package directory for package %s was not found." name)
|> Seq.map (fun kv -> findPackageFolder root kv.Key)
|> Seq.choose (fun packageDir ->
packageDir.GetDirectories("Content")
|> Array.append (packageDir.GetDirectories("content"))
Expand Down

0 comments on commit c64d973

Please sign in to comment.