feat: support better domain defaults
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
Closes coop-cloud/organising#221.
This commit is contained in:
parent
f2b02e39a7
commit
ab02c5f0dd
|
@ -8,6 +8,7 @@ import (
|
|||
"coopcloud.tech/abra/cli/internal"
|
||||
"coopcloud.tech/abra/pkg/catalogue"
|
||||
"coopcloud.tech/abra/pkg/config"
|
||||
"coopcloud.tech/abra/pkg/recipe"
|
||||
"coopcloud.tech/abra/pkg/secret"
|
||||
"github.com/AlecAivazis/survey/v2"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
@ -92,10 +93,11 @@ var appNewCommand = &cli.Command{
|
|||
}
|
||||
|
||||
// ensureDomainFlag checks if the domain flag was used. if not, asks the user for it/
|
||||
func ensureDomainFlag() error {
|
||||
func ensureDomainFlag(recipe recipe.Recipe, server string) error {
|
||||
if domain == "" {
|
||||
prompt := &survey.Input{
|
||||
Message: "Specify app domain",
|
||||
Default: fmt.Sprintf("%s.%s", recipe.Name, server),
|
||||
}
|
||||
if err := survey.AskOne(prompt, &domain); err != nil {
|
||||
return err
|
||||
|
@ -175,7 +177,7 @@ func action(c *cli.Context) error {
|
|||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
if err := ensureDomainFlag(); err != nil {
|
||||
if err := ensureDomainFlag(recipe, newAppServer); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue