Skip to content

Commit 69f6ec2

Browse files
Alessio Tregliahanjukim
andauthored
version --long displays replaced build dependencies (cosmos#7943)
From: cosmos#7941 Co-authored-by: Paul Kim <hanjukim@gmail.com>
1 parent 36ff5ca commit 69f6ec2

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
4040
### Features
4141

4242
* (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`.
43-
* (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.
43+
* (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.
4444

4545
### Improvements
4646

version/version.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ type buildDep struct {
9090
*debug.Module
9191
}
9292

93-
func (d buildDep) String() string { return fmt.Sprintf("%s@%s", d.Path, d.Version) }
93+
func (d buildDep) String() string {
94+
if d.Replace != nil {
95+
return fmt.Sprintf("%s@%s => %s@%s", d.Path, d.Version, d.Replace.Path, d.Replace.Version)
96+
}
97+
98+
return fmt.Sprintf("%s@%s", d.Path, d.Version)
99+
}
100+
94101
func (d buildDep) MarshalJSON() ([]byte, error) { return json.Marshal(d.String()) }
95102
func (d buildDep) MarshalYAML() (interface{}, error) { return d.String(), nil }

0 commit comments

Comments
 (0)