-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(version): add details reported by "qri version"
since we ask for the output of "qri version" of bug reports, adding more info to the version command will really help debugging. Specifically, getting the git commitish hash to print as part of "qri version". this requires using "make" to build instead of go install and go build directly, but is well worth it. All of this is directly inspired by great work over at github.com/textileio/powergate
- Loading branch information
Showing
9 changed files
with
51 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,34 @@ | ||
package version | ||
|
||
// String is the version number of qri | ||
const String = "0.9.14-dev" | ||
import "fmt" | ||
|
||
var ( | ||
// Version is set by govvv at build time | ||
Version = "n/a" | ||
// GitCommit is set by govvv at build time | ||
GitCommit = "n/a" | ||
// GitBranch is set by govvv at build time | ||
GitBranch = "n/a" | ||
// GitState is set by govvv at build time | ||
GitState = "n/a" | ||
// GitSummary is set by govvv at build time | ||
GitSummary = "n/a" | ||
// BuildDate is set by govvv at build time | ||
BuildDate = "n/a" | ||
// GolangVersion is set by govvv at build time | ||
GolangVersion = "n/a" | ||
) | ||
|
||
// Summary prints a summary of all build info. | ||
func Summary() string { | ||
return fmt.Sprintf( | ||
"version:\t%s\n\nbuild date:\t%s\ngit summary:\t%s\ngit branch:\t%s\ngit commit:\t%s\ngit state:\t%s\ngolang version:\t%s", | ||
Version, | ||
BuildDate, | ||
GitSummary, | ||
GitBranch, | ||
GitCommit, | ||
GitState, | ||
GolangVersion, | ||
) | ||
} |