Skip to content

Commit

Permalink
Finally fix terribly working version script
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalyisaev2 committed Nov 11, 2024
1 parent 88c9a7f commit 6a6035c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
34 changes: 17 additions & 17 deletions app/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ var Cmd = &cobra.Command{
func GetInfo() string {
sb := strings.Builder{}

sb.WriteString(`Git info:\n`)
sb.WriteString(fmt.Sprintf(`\tBranch: %s\n`, branch))
sb.WriteString(fmt.Sprintf(`\tCommit: %s\n`, commitHash))
sb.WriteString(fmt.Sprintf(`\tTag: %s\n`, tag))
sb.WriteString(fmt.Sprintf(`\tAuthor: %s\n`, author))
sb.WriteString(fmt.Sprintf(`\tSummary: %s\n`, commitMessage))
sb.WriteString(fmt.Sprintf(`\tCommit Date: %s\n\n`, commitDate))
sb.WriteString(`Other info:\n`)
sb.WriteString(fmt.Sprintf(`\tBuilt by: %s\n`, username))
sb.WriteString(fmt.Sprintf(`\tBuilding location: %s\n`, buildLocation))
sb.WriteString(fmt.Sprintf(`\tHostname: %s\n`, hostname))
sb.WriteString(`\tHost information:\n`)
sb.WriteString(fmt.Sprintf(`\t\t%s\n\n`, hostInfo))
sb.WriteString(`Build info:\n`)
sb.WriteString(fmt.Sprintf(`\tCompiler: %s\n`, pathToGo))
sb.WriteString(`\tCompiler version:\n`)
sb.WriteString(fmt.Sprintf(`\t\t%s\n`, goVersion))
sb.WriteString("VCS info:\n\n\n")
sb.WriteString(fmt.Sprintf("\tBranch: %s\n", branch))
sb.WriteString(fmt.Sprintf("\tCommit: %s\n", commitHash))
sb.WriteString(fmt.Sprintf("\tTag: %s\n", tag))
sb.WriteString(fmt.Sprintf("\tAuthor: %s\n", author))
sb.WriteString(fmt.Sprintf("\tSummary: %s\n", commitMessage))
sb.WriteString(fmt.Sprintf("\tCommit Date: %s\n\n", commitDate))
sb.WriteString("Other info:\n")
sb.WriteString(fmt.Sprintf("\tBuilt by: %s\n", username))
sb.WriteString(fmt.Sprintf("\tBuilding location: %s\n", buildLocation))
sb.WriteString(fmt.Sprintf("\tHostname: %s\n", hostname))
sb.WriteString("\tHost information:\n")
sb.WriteString(fmt.Sprintf("\t\t%s\n\n", hostInfo))
sb.WriteString("Build info:\n")
sb.WriteString(fmt.Sprintf("\tCompiler: %s\n", pathToGo))
sb.WriteString("\tCompiler version:\n")
sb.WriteString(fmt.Sprintf("\t\t%s\n", goVersion))

return sb.String()
}
4 changes: 2 additions & 2 deletions tools/version/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func getArcVersion() (versionData, error) {
}

commitHash = strings.TrimSpace(commitHash)
commitMessage = strings.Trim(commitMessage, " `")
commitMessage = strings.ReplaceAll(commitMessage, "`", "'")
username = strings.TrimSpace(username)
buildLocation = strings.TrimSpace(buildLocation)
hostname = strings.TrimSpace(hostname)
Expand Down Expand Up @@ -286,7 +286,7 @@ func getGitVersion() (versionData, error) {
tag = strings.TrimSpace(tag)
author = strings.TrimSpace(author)
commitDate = strings.TrimSpace(commitDate)
commitMessage = strings.Trim(commitMessage, " `")
commitMessage = strings.ReplaceAll(commitMessage, "`", "'")
username = strings.TrimSpace(username)
buildLocation = strings.TrimSpace(buildLocation)
hostname = strings.TrimSpace(hostname)
Expand Down

0 comments on commit 6a6035c

Please sign in to comment.