mirror of
https://github.com/hashicorp/packer.git
synced 2026-05-28 04:35:38 -04:00
version: compute SemVer from rawVersion
A bug in the SDK prevents us from calling SemVer on the PluginVersion derived from the rawVersion, as when doing so, we reset the semVer attribute to only use the core part of the version, thereby dropping any information on pre-release/metadata. This is not ideal, and arguably not wanted. So in order to not lose this information, we re-compute the SemVer from rawVersion, this way we don't overwrite it for both structures.
This commit is contained in:
parent
f767d06f93
commit
410e59f141
1 changed files with 5 additions and 1 deletions
|
|
@ -54,7 +54,11 @@ func init() {
|
|||
rawVersion = strings.TrimSpace(rawVersion)
|
||||
|
||||
PackerVersion = pluginVersion.NewRawVersion(rawVersion)
|
||||
SemVer = PackerVersion.SemVer()
|
||||
// A bug in the SDK prevents us from calling SemVer on the PluginVersion
|
||||
// derived from the rawVersion, as when doing so, we reset the semVer
|
||||
// attribute to only use the core part of the version, thereby dropping any
|
||||
// information on pre-release/metadata.
|
||||
SemVer, _ = version.NewVersion(rawVersion)
|
||||
|
||||
Version = PackerVersion.GetVersion()
|
||||
VersionPrerelease = PackerVersion.GetVersionPrerelease()
|
||||
|
|
|
|||
Loading…
Reference in a new issue