Skip to content

Commit

Permalink
fix: wrong skip logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Icaruk committed May 5, 2023
1 parent 1c9aba2 commit c4c7d22
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions pkg/updater/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -634,8 +634,6 @@ func Init(cfg CmdFlags) {

for {

freezeProgressCount := false

response, err := promptUpdateDependency(
updatePackageOptions,
key,
Expand All @@ -646,23 +644,24 @@ func Init(cfg CmdFlags) {
totalCount,
)

if !freezeProgressCount {
updateProgressCount++
}

if err != nil {
if err == terminal.InterruptErr {
log.Fatal("interrupted")
}
}

if response == updatePackageOptions.skip {
freezeProgressCount = true
updateProgressCount++
break
}

if response == updatePackageOptions.finish {
fmt.Println("Finished update process")
exit = true
break
}

if response == updatePackageOptions.show_changes {
freezeProgressCount = true

// Open browser url
var url string
Expand All @@ -675,7 +674,6 @@ func Init(cfg CmdFlags) {

if url == "" {
fmt.Println(aurora.Yellow("No repository or homepage URL found"))
break
}

fmt.Println("Opening...")
Expand All @@ -690,14 +688,10 @@ func Init(cfg CmdFlags) {
entry.shouldUpdate = true // then modify the copy
versionComparison[key] = entry // then reassign map entry
}
updateProgressCount++
break
}

if response == updatePackageOptions.finish {
fmt.Println("Finished update process")
exit = true
break
}
}

if exit {
Expand Down

0 comments on commit c4c7d22

Please sign in to comment.