diff options
| author | Shulhan <ms@kilabit.info> | 2018-05-27 01:51:46 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2018-05-27 02:34:34 +0700 |
| commit | c8ec4eef5463d072717fc1a2ce96d5a2dc873a74 (patch) | |
| tree | 49bc40b23dc4a8b383aa9efdf64b08d38e41f283 /env.go | |
| parent | 8899b54af622ccfd18d7d1b9ef8903801fe64005 (diff) | |
| download | beku-c8ec4eef5463d072717fc1a2ce96d5a2dc873a74.tar.xz | |
env.SyncAll: display compare URL for manual reviewing
Diffstat (limited to 'env.go')
| -rw-r--r-- | env.go | 22 |
1 files changed, 15 insertions, 7 deletions
@@ -832,9 +832,10 @@ func (env *Env) SyncAll() (err error) { buf bytes.Buffer ) - format := fmt.Sprintf("%%-%ds %%-12s %%-12s\n", env.fmtMaxPath) + format := fmt.Sprintf("%%-%ds %%-12s %%-12s %%s\n", env.fmtMaxPath) fmt.Fprintf(&buf, ">>> The following packages will be updated,\n\n") - fmt.Fprintf(&buf, format+"\n", "ImportPath", "Old Version", "New Version") + fmt.Fprintf(&buf, format+"\n", "ImportPath", "Old Version", + "New Version", "Compare URL") fmt.Println(">>> Updating all packages ...") @@ -844,13 +845,20 @@ func (env *Env) SyncAll() (err error) { if err != nil { return } - if pkg.Version != pkg.VersionNext { - fmt.Printf(">>> Latest version is %s\n", pkg.VersionNext) - fmt.Fprintf(&buf, format, pkg.ImportPath, pkg.Version, pkg.VersionNext) - countUpdate++ - } else { + if pkg.Version == pkg.VersionNext { fmt.Println(">>> No update.") + continue } + + fmt.Printf(">>> Latest version is %s\n", pkg.VersionNext) + + compareURL := GetCompareURL(pkg.RemoteURL, pkg.Version, + pkg.VersionNext) + + fmt.Fprintf(&buf, format, pkg.ImportPath, pkg.Version, + pkg.VersionNext, compareURL) + + countUpdate++ } if countUpdate == 0 { |
