chocolatey / Chocolatey.Cake.Recipe

A set of convention based Cake scripts for building Chocolatey projects
Apache License 2.0
5 stars 9 forks source link

(#162) Rework prerelease substring #163

Open corbob opened 3 weeks ago

corbob commented 3 weeks ago

Description Of Changes

This reworks the way we handle the prerelease version. Before if you had a less than 9 character branch that started with a number, we would prepend the letter a, then take the first 9 characters. This would result in an exception. Further, if you had a greater than 10 character branch name, we would remove the - in it and take the first 10 characters from that. With an 11 character branch with 2 - this would be an error as the max length to take is 9. Instead now we will work just on the part of the string we're fixing, with the max length being the last one handled.

Motivation and Context

Prevent some edge cases where the build fails.

Testing

  1. Copy the files from this PR into the correct place in the Chocolatey/choco repository.
  2. Run the build there for branches named: 3465-msi, gh-3465-msi, gh-3465-msi1.
  3. Note that the build now succeeds.

Operating Systems Testing

Change Types Made

Change Checklist

Related Issue

Fixes #162