diff --git a/cli/app/logs.go b/cli/app/logs.go index 551361e4..e099cec8 100644 --- a/cli/app/logs.go +++ b/cli/app/logs.go @@ -111,7 +111,7 @@ var appLogsCommand = &cli.Command{ return nil }, BashComplete: func(c *cli.Context) { - appNames, err := config.GetAppsNames() + appNames, err := config.GetAppNames() if err != nil { return } diff --git a/cli/app/ps.go b/cli/app/ps.go index 1883fc11..d840802d 100644 --- a/cli/app/ps.go +++ b/cli/app/ps.go @@ -57,7 +57,7 @@ var appPsCommand = &cli.Command{ return nil }, BashComplete: func(c *cli.Context) { - appNames, err := config.GetAppsNames() + appNames, err := config.GetAppNames() if err != nil { return } diff --git a/cli/app/remove.go b/cli/app/remove.go index 737d1402..30accbc7 100644 --- a/cli/app/remove.go +++ b/cli/app/remove.go @@ -156,7 +156,7 @@ var appRemoveCommand = &cli.Command{ return nil }, BashComplete: func(c *cli.Context) { - appNames, err := config.GetAppsNames() + appNames, err := config.GetAppNames() if err != nil { return } diff --git a/cli/app/undeploy.go b/cli/app/undeploy.go index 4393ff84..0b3d3f80 100644 --- a/cli/app/undeploy.go +++ b/cli/app/undeploy.go @@ -38,7 +38,7 @@ volumes as eligiblef or pruning once undeployed. return nil }, BashComplete: func(c *cli.Context) { - appNames, err := config.GetDeployedApps() + appNames, err := config.GetAppNames() if err != nil { return } diff --git a/cli/app/volume.go b/cli/app/volume.go index 0128e4c0..cb562ef2 100644 --- a/cli/app/volume.go +++ b/cli/app/volume.go @@ -84,7 +84,7 @@ var appVolumeRemoveCommand = &cli.Command{ return nil }, BashComplete: func(c *cli.Context) { - appNames, err := config.GetAppsNames() + appNames, err := config.GetAppNames() if err != nil { return } diff --git a/pkg/config/app.go b/pkg/config/app.go index bead851a..3d6b65ed 100644 --- a/pkg/config/app.go +++ b/pkg/config/app.go @@ -177,14 +177,14 @@ func GetApps(appFiles AppFiles) ([]App, error) { return apps, nil } -func GetAppsNames() ([]string, error) { +func GetAppNames() ([]string, error) { appFiles, err := LoadAppFiles("") if err != nil { - return nil, err + return []string{}, err } apps, err := GetApps(appFiles) if err != nil { - return nil, err + return []string{}, err } var appNames []string @@ -195,28 +195,6 @@ func GetAppsNames() ([]string, error) { return appNames, nil } -func GetDeployedApps() ([]string, error) { - appFiles, err := LoadAppFiles("") - if err != nil { - return nil, err - } - apps, err := GetApps(appFiles) - if err != nil { - return nil, err - } - statuses, err := GetAppStatuses(appFiles) - - var appNames []string - for _, app := range apps { - status := statuses[app.StackName()] - if status == "deployed" { - appNames = append(appNames, app.Name) - } - } - - return appNames, nil -} - // CopyAppEnvSample copies the example env file for the app into the users env files func CopyAppEnvSample(appType, appName, server string) error { envSamplePath := path.Join(ABRA_DIR, "apps", appType, ".env.sample")