Skip to content

Commit 68d4ef9

Browse files
committed
required changes
1 parent 170cafa commit 68d4ef9

File tree

1 file changed

+21
-15
lines changed

1 file changed

+21
-15
lines changed

cmd/build.go

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -410,24 +410,30 @@ func (c buildConfig) Prompt() (buildConfig, error) {
410410
Default: c.Push,
411411
},
412412
},
413-
{
414-
Name: "builderImage",
415-
Prompt: &survey.Input{
416-
Message: "Optional custom builder image:",
417-
Default: c.BuilderImage,
418-
},
419-
},
420-
{
421-
Name: "baseImage",
422-
Prompt: &survey.Input{
423-
Message: "Optional base image for your function (host builder only):",
424-
Default: c.BaseImage,
425-
},
426-
},
427413
}
428414

429415
err = survey.Ask(qs, &c)
430-
return c, err
416+
if err != nil {
417+
return c, err
418+
}
419+
420+
if c.Builder == "host" {
421+
hostQs := []*survey.Question{
422+
{
423+
Name: "baseImage",
424+
Prompt: &survey.Input{
425+
Message: "Optional base image for your function (host builder only):",
426+
Default: c.BaseImage,
427+
},
428+
},
429+
}
430+
err = survey.Ask(hostQs, &c)
431+
if err != nil {
432+
return c, err
433+
}
434+
}
435+
436+
return c, nil
431437
}
432438

433439
// Validate the config passes an initial consistency check

0 commit comments

Comments
 (0)