Skip to content

Instantly share code, notes, and snippets.

@mavnn
Created November 28, 2013 16:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mavnn/7694348 to your computer and use it in GitHub Desktop.
Save mavnn/7694348 to your computer and use it in GitHub Desktop.
Install NuGet stuff from code with sensible control of options.
(* 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