Created
November 28, 2013 16:15
-
-
Save mavnn/7694348 to your computer and use it in GitHub Desktop.
Install NuGet stuff from code with sensible control of options.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* Get the files in the right places relative to the script by running: | |
path\to\NuGet.exe install NuGetPlus.Core -ExcludeVersion -Prerelease | |
*) | |
#r "FSharp.Core" | |
#r "Microsoft.Build" | |
#r "Microsoft.Build.Framework" | |
#r "System.Xml" | |
#r "System.Xml.Linq" | |
#r "NuGet.Core/lib/net40-Client/NuGet.Core.dll" | |
#r "NuGetPlus.Core/lib/net40/NuGetPlus.Core.dll" | |
open System.IO | |
open NuGet | |
open NuGetPlus.Floating | |
let optionSetter someVersion defaults = | |
{ defaults with | |
AllowPrerelease = true | |
IgnoreDependencies = false | |
SemanticVersion = someVersion | |
VersionedDirectory = false | |
} | |
let installDirectory = "test" | |
let fullName = Directory.CreateDirectory(installDirectory).FullName | |
printfn "%A" <| optionSetter None DefaultOptions | |
Install fullName (optionSetter None) "NuGetPlus.Core" | |
(* | |
Installs NuGetPlus and it's dependencies in ./test, | |
with directories without version numbers. | |
*) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment