为了指定其他内部公司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”。
答案 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)