Configure sets up the spinner with the given parameters.
(prdName, branchName, defaultBranch, worktreePath, setupCommand string)
| 50 | |
| 51 | // Configure sets up the spinner with the given parameters. |
| 52 | func (w *WorktreeSpinner) Configure(prdName, branchName, defaultBranch, worktreePath, setupCommand string) { |
| 53 | w.prdName = prdName |
| 54 | w.branchName = branchName |
| 55 | w.defaultBranch = defaultBranch |
| 56 | w.worktreePath = worktreePath |
| 57 | w.setupCommand = setupCommand |
| 58 | w.currentStep = SpinnerStepCreateBranch |
| 59 | w.spinnerFrame = 0 |
| 60 | w.errMsg = "" |
| 61 | w.cancelled = false |
| 62 | |
| 63 | // Build steps list |
| 64 | w.steps = []stepInfo{ |
| 65 | {label: fmt.Sprintf("Creating branch '%s' from '%s'", branchName, defaultBranch)}, |
| 66 | {label: fmt.Sprintf("Creating worktree at %s", worktreePath)}, |
| 67 | } |
| 68 | if setupCommand != "" { |
| 69 | w.steps = append(w.steps, stepInfo{label: fmt.Sprintf("Running setup: %s", setupCommand)}) |
| 70 | } |
| 71 | |
| 72 | // Mark first step as active |
| 73 | if len(w.steps) > 0 { |
| 74 | w.steps[0].active = true |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | // SetSize sets the spinner dimensions. |
| 79 | func (w *WorktreeSpinner) SetSize(width, height int) { |
no outgoing calls