refactor: drop unused function, rename GetAppsNames
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
4c216fdf40
commit
cf2653fef8
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue