Skip to content

Commit 2b76308

Browse files
committed
consolidate version location
1 parent 8de190f commit 2b76308

2 files changed

Lines changed: 20 additions & 16 deletions

File tree

main.go

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,15 @@ import (
55
"os"
66

77
"github.com/hashicorp/packer-plugin-sdk/plugin"
8-
"github.com/hashicorp/packer-plugin-sdk/version"
9-
"github.com/hashicorp/packer-plugin-tencentcloud/builder/tencentcloud/cvm"
10-
)
11-
12-
var (
13-
// Version is the main version number that is being run at the moment.
14-
Version = "1.0.1"
158

16-
// VersionPrerelease is A pre-release marker for the Version. If this is ""
17-
// (empty string) then it means that it is a final release. Otherwise, this
18-
// is a pre-release such as "dev" (in development), "beta", "rc1", etc.
19-
VersionPrerelease = ""
20-
21-
// PluginVersion is used by the plugin set to allow Packer to recognize
22-
// what version this plugin is.
23-
PluginVersion = version.InitializePluginVersion(Version, VersionPrerelease)
9+
"github.com/hashicorp/packer-plugin-tencentcloud/builder/tencentcloud/cvm"
10+
"github.com/hashicorp/packer-plugin-tencentcloud/version"
2411
)
2512

2613
func main() {
2714
pps := plugin.NewSet()
2815
pps.RegisterBuilder("cvm", new(cvm.Builder))
29-
pps.SetVersion(PluginVersion)
16+
pps.SetVersion(version.PluginVersion)
3017
err := pps.Run()
3118
if err != nil {
3219
fmt.Fprintln(os.Stderr, err.Error())

version/version.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package version
2+
3+
import "github.com/hashicorp/packer-plugin-sdk/version"
4+
5+
var (
6+
// Version is the main version number that is being run at the moment.
7+
Version = "1.0.1"
8+
9+
// VersionPrerelease is A pre-release marker for the Version. If this is ""
10+
// (empty string) then it means that it is a final release. Otherwise, this
11+
// is a pre-release such as "dev" (in development), "beta", "rc1", etc.
12+
VersionPrerelease = "dev"
13+
14+
// PluginVersion is used by the plugin set to allow Packer to recognize
15+
// what version this plugin is.
16+
PluginVersion = version.InitializePluginVersion(Version, VersionPrerelease)
17+
)

0 commit comments

Comments
 (0)