(c *cli.Command)
| 252 | } |
| 253 | |
| 254 | func ExtractDatabaseNameFromCommandLineOrEnv(c *cli.Command) string { |
| 255 | if os.Getenv("SCALINGO_PREVIEW_FEATURES") != "true" { |
| 256 | return "" |
| 257 | } |
| 258 | |
| 259 | for _, cliContext := range c.Lineage() { |
| 260 | dbName := cliContext.String("database") |
| 261 | if dbName != "" && dbName != "<database_name>" { |
| 262 | return dbName |
| 263 | } |
| 264 | } |
| 265 | |
| 266 | var dbName string |
| 267 | |
| 268 | if os.Getenv("SCALINGO_DATABASE") != "" { |
| 269 | dbName = os.Getenv("SCALINGO_DATABASE") |
| 270 | } |
| 271 | |
| 272 | return dbName |
| 273 | } |
| 274 | |
| 275 | // extractAppNameFromGitRemote parses a Git remote and return the app name extracted |
| 276 | // out of it. The Git remote URL may look like: |
no outgoing calls
no test coverage detected