Skip to content

Commit 092e4a2

Browse files
Make newt upgrade more verbose
This improves newt upgrade output to include message when it's fetching updates to each repository and also skips "trying to make changes..." message if there's no prompt requested.
1 parent 16b850e commit 092e4a2

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

newt/install/install.go

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,7 @@ func (inst *Installer) filterUpgradeList(
289289
}
290290
curVer.Commit = ver.Commit
291291
util.StatusMessage(util.VERBOSITY_DEFAULT,
292-
"Skipping \"%s\": already upgraded (%s)\n",
293-
name, curVer.String())
292+
"Skipping %s, already upgraded to version %s\n", name, curVer.String())
294293
}
295294
}
296295

@@ -348,6 +347,9 @@ func (inst *Installer) installPrompt(vm deprepo.VersionMap, op installOp,
348347
return true, nil
349348
}
350349

350+
if !ask {
351+
return true, nil
352+
}
351353
util.StatusMessage(util.VERBOSITY_DEFAULT,
352354
"Trying to make the following changes to the project:\n")
353355

@@ -374,10 +376,6 @@ func (inst *Installer) installPrompt(vm deprepo.VersionMap, op installOp,
374376
}
375377
}
376378

377-
if !ask {
378-
return true, nil
379-
}
380-
381379
for {
382380
fmt.Printf("Proceed? [Y/n] ")
383381
line, more, err := bufio.NewReader(os.Stdin).ReadLine()
@@ -570,13 +568,12 @@ func (inst *Installer) Upgrade(candidates []*repo.Repo, force bool,
570568
}
571569
}
572570

571+
util.StatusMessage(util.VERBOSITY_DEFAULT,
572+
"Upgrading %s to version %s\n", r.Name(), destVer.String())
573+
573574
if err := r.Upgrade(destVer); err != nil {
574575
return err
575576
}
576-
577-
util.StatusMessage(util.VERBOSITY_DEFAULT,
578-
"%s successfully upgraded to version %s\n",
579-
r.Name(), destVer.String())
580577
}
581578

582579
for _, r := range candidates {

newt/repo/repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ func (r *Repo) UpdateDesc() (bool, error) {
382382
return false, nil
383383
}
384384

385-
util.StatusMessage(util.VERBOSITY_VERBOSE, "[%s]:\n", r.Name())
385+
util.StatusMessage(util.VERBOSITY_DEFAULT, "Fetching %s\n", r.Name())
386386

387387
// Make sure the repo's "origin" remote points to the correct URL. This is
388388
// necessary in case the user changed his `project.yml` file to point to a

0 commit comments

Comments
 (0)