Let's say I have a following folder structure
build
build.fsx
build.bat
//build tools etc.
src
Project1
Project2
//...
When I run my RestorePackages() in build.fsx it will look for packages.config in "./**/packages.config" (according to documentation), and will ignore all packages to be restored in project folders.
I can use this method and probably give path one-by-one to every project's packages.config, but I don't want to change build script every time I add new project to solution.
Is there a way, to make RestorePackages() to look for all packages.config in some specific path?
EDITED:
Additional, related question. I see, I'll have to pass nuget path to RestorePackage, because by default it seems to expect it in ./tools/nuget/nuget.exe. I can do this probably like that:
RestorePackage(fun p -> { p with ToolPath = "my/nuget/path"})
But I have no idea how to tie it into example you provided. F# syntax is still a little bit confusing for me around pipes and function calls.
I see two solutions.
let RestorePackages() = !! "./../**/packages.config" |> Seq.iter (RestorePackage id)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With