Merge branch 'trunk' into create-autolinks
This commit is contained in:
commit
c09b5fa551
2 changed files with 12 additions and 3 deletions
|
|
@ -469,9 +469,18 @@ func (m *Manager) Upgrade(name string, force bool) error {
|
|||
}
|
||||
|
||||
func (m *Manager) upgradeExtensions(exts []*Extension, force bool) error {
|
||||
var longestExtName = 0
|
||||
for _, ext := range exts {
|
||||
l := len(ext.Name())
|
||||
if len(ext.Name()) > longestExtName {
|
||||
longestExtName = l
|
||||
}
|
||||
}
|
||||
format := fmt.Sprintf("[%%%ds]: ", longestExtName)
|
||||
|
||||
var failed bool
|
||||
for _, f := range exts {
|
||||
fmt.Fprintf(m.io.Out, "[%s]: ", f.Name())
|
||||
fmt.Fprintf(m.io.Out, format, f.Name())
|
||||
currentVersion := displayExtensionVersion(f, f.CurrentVersion())
|
||||
err := m.upgradeExtension(f, force)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ func TestManager_UpgradeExtensions(t *testing.T) {
|
|||
`
|
||||
[hello]: upgraded from old vers to new vers
|
||||
[local]: local extensions can not be upgraded
|
||||
[two]: upgraded from old vers to new vers
|
||||
[ two]: upgraded from old vers to new vers
|
||||
`,
|
||||
), stdout.String())
|
||||
assert.Equal(t, "", stderr.String())
|
||||
|
|
@ -293,7 +293,7 @@ func TestManager_UpgradeExtensions_DryRun(t *testing.T) {
|
|||
`
|
||||
[hello]: would have upgraded from 0 to 1
|
||||
[local]: local extensions can not be upgraded
|
||||
[two]: would have upgraded from 2 to 3
|
||||
[ two]: would have upgraded from 2 to 3
|
||||
`,
|
||||
), stdout.String())
|
||||
assert.Equal(t, "", stderr.String())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue