AdvanceStep marks the current step as complete and moves to the next.
()
| 83 | |
| 84 | // AdvanceStep marks the current step as complete and moves to the next. |
| 85 | func (w *WorktreeSpinner) AdvanceStep() { |
| 86 | idx := int(w.currentStep) |
| 87 | if idx < len(w.steps) { |
| 88 | w.steps[idx].complete = true |
| 89 | w.steps[idx].active = false |
| 90 | } |
| 91 | |
| 92 | w.currentStep++ |
| 93 | |
| 94 | // Skip setup step if no setup command |
| 95 | if w.currentStep == SpinnerStepRunSetup && w.setupCommand == "" { |
| 96 | w.currentStep = SpinnerStepDone |
| 97 | } |
| 98 | |
| 99 | nextIdx := int(w.currentStep) |
| 100 | if nextIdx < len(w.steps) { |
| 101 | w.steps[nextIdx].active = true |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | // SetError sets an error on the current step. |
| 106 | func (w *WorktreeSpinner) SetError(err string) { |
no outgoing calls