@@ -125,7 +125,7 @@ func runGenerate(ctx context.Context, opts *generateOptions) error {
125125 return err
126126 }
127127
128- progressTrackerManager , confirm := initProgressTrackerManager (ctx , opts .renderer , opts .useTTY )
128+ progressTrackerManager , confirm := initProgressTrackerManager (ctx , opts .renderer , opts .useTTY , opts . forceGeneration )
129129
130130 out := general .NewOutput (generationCfg , opts .continueGeneration , opts .forceGeneration , confirm )
131131
@@ -176,11 +176,12 @@ func runGenerate(ctx context.Context, opts *generateOptions) error {
176176}
177177
178178// initProgressTrackerManager inits progress bar manager (progress.Tracker)
179- // and builds streams .Confirm func based on useTTY.
179+ // and builds confirm .Confirm func based on useTTY and forceGeneration .
180180func initProgressTrackerManager (
181181 ctx context.Context ,
182182 renderer render.Renderer ,
183183 useTTY bool ,
184+ forceGeneration bool ,
184185) (progress.Tracker , confirm.Confirm ) {
185186 var (
186187 progressTrackerManager progress.Tracker
@@ -199,6 +200,12 @@ func initProgressTrackerManager(
199200 confirmFunc = confirm .BuildConfirmNoTTY (renderer , progressTrackerManager , isUpdatePaused )
200201 }
201202
203+ if forceGeneration {
204+ confirmFunc = func (_ context.Context , _ string ) (bool , error ) {
205+ return true , nil
206+ }
207+ }
208+
202209 return progressTrackerManager , confirmFunc
203210}
204211
0 commit comments