We use `git describe --tags` to construct a version number based on the current version tag. The properties VERSION (when using make) and Version (when using MSBuild) can be explicitly set to use a fixed value instead. Fixes #13
21 lines
436 B
Go
21 lines
436 B
Go
// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
|
|
|
|
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/pulumi/pulumi/pkg/util/cmdutil"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func newVersionCmd(version string) *cobra.Command {
|
|
return &cobra.Command{
|
|
Use: "version",
|
|
Short: "Print Pulumi's version number",
|
|
Run: cmdutil.RunFunc(func(cmd *cobra.Command, args []string) error {
|
|
fmt.Printf("%v\n", version)
|
|
return nil
|
|
}),
|
|
}
|
|
}
|