I've created my build script that generates a NuGet package from my project and I'm now trying to pull the version number from TeamCity rather than using a static value inside my script.
My current code is like this (within a Target)
NuGet (fun p ->
{p with
Authors = authors
Project = projectName
Description = projectDescription
OutputPath = packagingRoot
Summary = projectSummary
WorkingDir = packagingDir
Version = TeamCityHelper.TeamCityBuildNumber }) "myProject.nuspec"
The problem is that the TeamCity helper that comes bundled with FAKE returns an optional string instead of a string, where as the NuGet call takes a string.
This is my first time using F#, how would I go about getting TeamCityHelper.TeamCityBuildNumber
as a string and not an optional so it's ready for the NuGet step? Preferably I'd like to kill the build if nothing is returned from TeamCity for the version number, but for now I'd like to just throw in a place holder of something like "0.0.1".