@@ -125,7 +125,7 @@ func runGenerate(ctx context.Context, opts *generateOptions) error {
125
125
return err
126
126
}
127
127
128
- progressTrackerManager , confirm := initProgressTrackerManager (ctx , opts .renderer , opts .useTTY )
128
+ progressTrackerManager , confirm := initProgressTrackerManager (ctx , opts .renderer , opts .useTTY , opts . forceGeneration )
129
129
130
130
out := general .NewOutput (generationCfg , opts .continueGeneration , opts .forceGeneration , confirm )
131
131
@@ -176,11 +176,12 @@ func runGenerate(ctx context.Context, opts *generateOptions) error {
176
176
}
177
177
178
178
// 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 .
180
180
func initProgressTrackerManager (
181
181
ctx context.Context ,
182
182
renderer render.Renderer ,
183
183
useTTY bool ,
184
+ forceGeneration bool ,
184
185
) (progress.Tracker , confirm.Confirm ) {
185
186
var (
186
187
progressTrackerManager progress.Tracker
@@ -199,6 +200,12 @@ func initProgressTrackerManager(
199
200
confirmFunc = confirm .BuildConfirmNoTTY (renderer , progressTrackerManager , isUpdatePaused )
200
201
}
201
202
203
+ if forceGeneration {
204
+ confirmFunc = func (_ context.Context , _ string ) (bool , error ) {
205
+ return true , nil
206
+ }
207
+ }
208
+
202
209
return progressTrackerManager , confirmFunc
203
210
}
204
211
0 commit comments