F#Make - 使用PreRelease选项恢复某些Nuget包

时间:2015-05-06 13:50:14

标签: f#-fake

为了指定其他内部公司Nuget供稿,我目前正在使用RestorePackages这样:

let RestorePackages() =
    !! "./**/packages.config"
    |> Seq.iter (RestorePackage(fun p -> {p with Sources = "http://internal.example.com/nuget" :: p.Sources}))

哪个效果很好。如何通过设置IncludePreRelease选项来恢复某些软件包的脚本?

我已尝试在这样的包装上进行匹配:

let RestorePackages() =
    !! "./**/packages.config"
    |> Seq.iter (fun item ->
        match item with
        | "Example" -> RestorePackageId(fun p -> {p with IncludePreRelease = true}) "Example"
        | item -> RestorePackage(fun p -> {p with Sources = "http://internal.example.com/nuget" :: p.Sources}))

但这不起作用。调用RestorePackage的默认匹配表示“此表达式应具有类型单位,但此处具有类型字符串 - > unit”。

1 个答案:

答案 0 :(得分:0)

看起来你在最后一个代码行末尾缺少一个字符串。我认为你应该在那里传递item变量。

    let RestorePackages() =
        !! "./**/packages.config"
        |> Seq.iter (fun item ->
            match item with
            | "Example" -> RestorePackageId(fun p -> {p with IncludePreRelease = true}) "Example"
            | item -> RestorePackage(fun p -> {p with Sources = "http://internal.example.com/nuget" :: p.Sources}) item)