Skip to content

Commit

Permalink
Add publishing new version with any kind of version string
Browse files Browse the repository at this point in the history
  • Loading branch information
Gert-Jan Hommersom committed Jun 3, 2021
1 parent 8050f55 commit 4a92473
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Cake.Yarn.Tests/YarnPublishTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ public void New_Version_Option_Should_Format_Correctly()
result.Args.ShouldBe($"publish --new-version {major}.{minor}.{patch}");
}

[Fact]
public void New_Version_Option_Should_Pass_Through_String()
{
const string version = "2016.9.1-rc1";

_fixture.PublishSettings = s => s.NewVersion(version);

var result = _fixture.Run();

result.Args.ShouldBe($"publish --new-version {version}");
}

[Fact]
public void Tag_Option_Should_Use_Tag_Argument()
{
Expand Down
9 changes: 9 additions & 0 deletions src/Cake.Yarn/YarnPublishSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ public YarnPublishSettings NewVersion(int major, int minor, int patch)
return this;
}

/// <summary>Applies the --new-version parameter.</summary>
/// <param name="version">The version</param>
/// <returns></returns>
public YarnPublishSettings NewVersion(string version)
{
_newVersion = version;
return this;
}

/// <summary>
/// Applies the --tag parameter
/// </summary>
Expand Down

0 comments on commit 4a92473

Please sign in to comment.