Use hyphens for multiple Chocolatey prerelease components

This way 1.0.0-beta.1.1 won't conflict with 1.0.0-beta.11, for
example.
This commit is contained in:
Natalie Weizenbaum 2018-02-04 15:07:56 -08:00
parent d8336622a0
commit 01e768c885

View File

@ -283,7 +283,17 @@ String _chocolateyVersion() {
var components = _version.split("-");
if (components.length == 1) return components.first;
assert(components.length == 2);
return "${components.first}-${components.last.replaceAll('.', '')}";
var first = true;
var prerelease = components.last.replaceAllMapped('.', (_) {
if (first) {
first = false;
return '';
} else {
return '-';
}
});
return "${components.first}-$prerelease";
}
/// Returns the contents of the `properties.psmdcp` file, computed from the