refactor: stack func to client, mv app to new file
Stack interaction is now under client. App types and functions moved from env to app under config
This commit is contained in:
@ -4,7 +4,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
"coopcloud.tech/abra/catalogue"
|
||||
abraFormatter "coopcloud.tech/abra/cli/formatter"
|
||||
@ -53,10 +52,6 @@ var appNewCommand = &cli.Command{
|
||||
Action: action,
|
||||
}
|
||||
|
||||
func sanitiseAppName(name string) string {
|
||||
return strings.ReplaceAll(name, ".", "_")
|
||||
}
|
||||
|
||||
func appLookup(appType string) (catalogue.App, error) {
|
||||
catl, err := catalogue.ReadAppsCatalogue()
|
||||
if err != nil {
|
||||
@ -110,7 +105,7 @@ func ensureAppNameFlag() error {
|
||||
if internal.AppName == "" {
|
||||
prompt := &survey.Input{
|
||||
Message: "Specify app name:",
|
||||
Default: sanitiseAppName(internal.Domain),
|
||||
Default: config.SanitiseAppName(internal.Domain),
|
||||
}
|
||||
if err := survey.AskOne(prompt, &internal.AppName); err != nil {
|
||||
return err
|
||||
@ -176,7 +171,7 @@ func action(c *cli.Context) error {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
sanitisedAppName := sanitiseAppName(internal.AppName)
|
||||
sanitisedAppName := config.SanitiseAppName(internal.AppName)
|
||||
if len(sanitisedAppName) > 45 {
|
||||
logrus.Fatalf("'%s' cannot be longer than 45 characters", sanitisedAppName)
|
||||
}
|
||||
|
Reference in New Issue
Block a user