(ctx context.Context, c *cli.Command)
| 230 | } |
| 231 | |
| 232 | func extractAppName(ctx context.Context, c *cli.Command) string { |
| 233 | for _, cliContext := range c.Lineage() { |
| 234 | appName := cliContext.String("app") |
| 235 | if appName != "" && appName != "<name>" { |
| 236 | return appName |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | var err error |
| 241 | var appName string |
| 242 | |
| 243 | if os.Getenv("SCALINGO_APP") != "" { |
| 244 | appName = os.Getenv("SCALINGO_APP") |
| 245 | } else if dir, ok := utils.DetectGit(); ok { |
| 246 | appName, err = GetAppNameFromGitRemote(ctx, dir, RemoteNameFromFlags(c)) |
| 247 | if err != nil { |
| 248 | debug.Println(err) |
| 249 | } |
| 250 | } |
| 251 | return appName |
| 252 | } |
| 253 | |
| 254 | func ExtractDatabaseNameFromCommandLineOrEnv(c *cli.Command) string { |
| 255 | if os.Getenv("SCALINGO_PREVIEW_FEATURES") != "true" { |
no test coverage detected