Skip to content

Commit

Permalink
fix: use shorter commit sha in version output (runatlantis#3163)
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocode authored and ijames-gc committed Feb 13, 2024
1 parent 8b798b0 commit 439796f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ func main() {
panic(fmt.Sprintf("unable to initialize logger. %s", err.Error()))
}

atlantisVersion := fmt.Sprintf("%s (commit: %s) (build date: %s)", version, commit, date)
var sha = commit
if len(commit) >= 7 {
sha = commit[:7]
}

atlantisVersion := fmt.Sprintf("%s (commit: %s) (build date: %s)", version, sha, date)

// We're creating commands manually here rather than using init() functions
// (as recommended by cobra) because it makes testing easier.
Expand Down

0 comments on commit 439796f

Please sign in to comment.