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:
@@ -26,6 +26,28 @@ func TriggerBuilderDetect(appName string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// TriggerBuilderImageIsCNB prints true if an image is cnb based, false otherwise
|
||||
func TriggerBuilderImageIsCNB(appName string, image string) error {
|
||||
if common.IsImageCnbBased(image) {
|
||||
fmt.Println("true")
|
||||
} else {
|
||||
fmt.Println("false")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// TriggerBuilderImageIsHerokuish prints true if an image is herokuish based, false otherwise
|
||||
func TriggerBuilderImageIsHerokuish(appName string, image string) error {
|
||||
if common.IsImageHerokuishBased(image, appName) {
|
||||
fmt.Println("true")
|
||||
} else {
|
||||
fmt.Println("false")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// TriggerCorePostExtract moves a configured build-dir to be in the app root dir
|
||||
func TriggerCorePostExtract(appName string, sourceWorkDir string) error {
|
||||
buildDir := strings.Trim(reportComputedBuildDir(appName), "/")
|
||||
|
||||
Reference in New Issue
Block a user