Skip to content

Commit

Permalink
version --long displays replaced build dependencies
Browse files Browse the repository at this point in the history
From: #7941
  • Loading branch information
hanjukim authored and Alessio Treglia committed Nov 16, 2020
1 parent 1bbffff commit ce8bab1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Features

* (types/coin.go) [\#6755](https://github.com/cosmos/cosmos-sdk/pull/6755) Add custom regex validation for `Coin` denom by overwriting `CoinDenomRegex` when using `/types/coin.go`.
* (version) [\#7835](https://github.com/cosmos/cosmos-sdk/issues/7835) The version --long command now shows the list of build dependencies and their versioning information.
* (version) [\#7835](https://github.com/cosmos/cosmos-sdk/issues/7835) [\#7940](https://github.com/cosmos/cosmos-sdk/issues/7940) The version --long command now shows the list of build dependencies and their versioning information.

### Bug Fixes

Expand Down
9 changes: 8 additions & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ type buildDep struct {
*debug.Module
}

func (d buildDep) String() string { return fmt.Sprintf("%s@%s", d.Path, d.Version) }
func (d buildDep) String() string {
if d.Replace != nil {
return fmt.Sprintf("%s@%s => %s@%s", d.Path, d.Version, d.Replace.Path, d.Replace.Version)
}

return fmt.Sprintf("%s@%s", d.Path, d.Version)
}

func (d buildDep) MarshalJSON() ([]byte, error) { return json.Marshal(d.String()) }
func (d buildDep) MarshalYAML() (interface{}, error) { return d.String(), nil }

0 comments on commit ce8bab1

Please sign in to comment.