Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 0045e8f

Browse files
committed
Add version/commit/date_built output to command
1 parent 9ecbec6 commit 0045e8f

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ brew tap coretech/terrafile && brew install terrafile
2424

2525
### Linux
2626
Download your preferred flavor from the [releases](https://github.com/coretech/terrafile/releases/latest) page and install manually.
27+
28+
For example:
2729
```sh
2830
curl -L https://github.com/coretech/terrafile/releases/download/v0.2/terrafile_0.2_linux_amd64.tar.gz | tar xz -C /usr/local/bin
2931
```

main.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ var opts struct {
2323
TerrafilePath string `short:"f" long:"terrafile_file" default:"." description:"File path in which the Terrafile file is located"`
2424
}
2525

26+
// To be set by goreleaser on build
27+
var (
28+
version = "dev"
29+
commit = "none"
30+
date = "unknown"
31+
)
32+
2633
func init() {
2734
// Needed to redirect logrus to proper stream STDOUT vs STDERR
2835
log.AddHook(stdemuxerhook.New(log.StandardLogger()))
@@ -39,6 +46,7 @@ func gitClone(repository string, version string, moduleName string) {
3946
}
4047

4148
func main() {
49+
log.Printf("Terraform: version %v, commit %v, built at %v", version, commit, date)
4250
_, err := flags.Parse(&opts)
4351

4452
// Invalid choice

0 commit comments

Comments
 (0)