diff options
author | Evangelos Pappas <epappas@evalonlabs.com> | 2018-01-04 00:18:53 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-01-04 00:18:53 +0800 |
commit | 7a59a9380e9f12729bb094de4151c3d135bdadf9 (patch) | |
tree | b29f44ad5c909d3afbd02b6e2018cdf2f27196c9 | |
parent | 762f3a48a00da02fe58063cb6ce8dc2d08821f15 (diff) | |
download | dexon-7a59a9380e9f12729bb094de4151c3d135bdadf9.tar dexon-7a59a9380e9f12729bb094de4151c3d135bdadf9.tar.gz dexon-7a59a9380e9f12729bb094de4151c3d135bdadf9.tar.bz2 dexon-7a59a9380e9f12729bb094de4151c3d135bdadf9.tar.lz dexon-7a59a9380e9f12729bb094de4151c3d135bdadf9.tar.xz dexon-7a59a9380e9f12729bb094de4151c3d135bdadf9.tar.zst dexon-7a59a9380e9f12729bb094de4151c3d135bdadf9.zip |
cmd/utils: handle git commit a bit safer for user specified strings (#15790)
* cmd/utils/flags.go: Applying a String len guard for the gitCommit param of the NewApp()
* cmd/utils: remove redundant clause in if condition
-rw-r--r-- | cmd/utils/flags.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 734cf6f36..edf3dc2c2 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -96,7 +96,7 @@ func NewApp(gitCommit, usage string) *cli.App { //app.Authors = nil app.Email = "" app.Version = params.Version - if gitCommit != "" { + if len(gitCommit) >= 8 { app.Version += "-" + gitCommit[:8] } app.Usage = usage |