fix: respect the build-dir in app-json extraction

Because the app-json extraction happens before the build-dir is set, it doesn't end up respecting the value, and thus the user might get the wrong app.json file.

This takes advantage of path.Join()'s default of ignoring empty paths.
This commit is contained in:
Jose Diaz-Gonzalez committed 2023-02-14 03:56:28 -05:00
1 parent 0eccfe8ba4
commit 87828515a1
5 files changed
+37 -3

No files matched your search

+11
View File
@@ -1,6 +1,7 @@
package builder
import (
"errors"
"fmt"
"io/ioutil"
"os"
@@ -26,6 +27,16 @@ func TriggerBuilderDetect(appName string) error {
return nil
}
// TriggerBuilderGetProperty writes the builder key to stdout for a given app container
func TriggerBuilderGetProperty(appName string, key string) error {
if key != "selected" && key != "build-dir" {
return errors.New("Invalid logs property specified")
}
fmt.Println(common.PropertyGet("builder", appName, key))
return nil
}
// TriggerBuilderImageIsCNB prints true if an image is cnb based, false otherwise
func TriggerBuilderImageIsCNB(appName string, image string) error {
if common.IsImageCnbBased(image) {