refactor: use a single implementation for checking cnb/herokuish images

Also use a plugin trigger for testing whether an image is herokuish or not rather than trying to mess around with sourced files.
This commit is contained in:
Jose Diaz-Gonzalez
2022-12-02 15:54:48 -05:00
parent a2cc6b84d6
commit c2ebf48524
10 changed files with 108 additions and 50 deletions

View File

@@ -32,6 +32,21 @@ func main() {
if !common.IsDeployed(appName) {
err = fmt.Errorf("App %v not deployed", appName)
}
case "image-is-cnb-based":
image := flag.Arg(1)
if common.IsImageCnbBased(image) {
fmt.Print("true")
} else {
fmt.Print("false")
}
case "image-is-herokuish-based":
image := flag.Arg(1)
appName := flag.Arg(2)
if common.IsImageHerokuishBased(image, appName) {
fmt.Print("true")
} else {
fmt.Print("false")
}
case "scheduler-detect":
appName := flag.Arg(1)
if *global {