removed spinner 12a20669
Steve · 2024-08-16 11:40 1 file(s) · +4 −9
main.go +4 −9
8 8
	"os/signal"
9 9
	"path/filepath"
10 10
	"syscall"
11 -
	"time"
12 11
13 12
	"github.com/AlecAivazis/survey/v2"
14 -
	"github.com/briandowns/spinner"
15 13
	"github.com/fatih/color"
16 14
)
17 15
95 93
	survey.AskOne(prompt, &confirm)
96 94
97 95
	if !confirm {
98 -
		fmt.Println("Operation cancelled.")
96 +
		fmt.Println("Radicalization cancelled.")
99 97
		return
100 98
	}
101 99
102 -
	s := spinner.New(spinner.CharSets[9], 100*time.Millisecond)
103 -
	s.Prefix = "Initializing repositories "
104 -
	s.Start()
100 +
	fmt.Printf("Initializing %d repositories as %s...\n", len(repos), visibilityStr)
105 101
106 102
	// Set up channel to listen for interrupt signal
107 103
	interrupt := make(chan os.Signal, 1)
118 114
				done <- true
119 115
				return
120 116
			default:
117 +
				fmt.Printf("Initializing %s (%d/%d)...\n", repo.Name, i+1, len(repos))
121 118
				err := runRadInit(repo.Path, repo.Name)
122 119
				if err != nil {
123 120
					color.Red("Error initializing %s: %v\n", repo.Name, err)
124 121
				} else {
125 122
					color.Green("Initialized %s as %s\n", repo.Name, visibilityStr)
126 123
				}
127 -
				s.Suffix = fmt.Sprintf(" (%d/%d)", i+1, len(repos))
128 124
			}
129 125
		}
130 126
		done <- true
131 127
	}()
132 128
133 129
	<-done
134 -
	s.Stop()
135 -
	fmt.Println("Initialization process completed or interrupted.")
130 +
	fmt.Println("Radicalization Complete")
136 131
}
137 132
138 133
func runRadInit(path, name string) error {