Validate BIND_DIR variable in Makefile

Signed-off-by: Maria Glushenok <glushenokm@gmail.com>
This commit is contained in:
Maria Glushenok
2025-06-04 23:15:10 +03:00
parent cee6f64ac7
commit ea581c96b9

View File

@@ -203,7 +203,7 @@ build: shell_target := --target=dev-base
else
build: shell_target := --target=dev
endif
build: bundles
build: validate-bind-dir bundles
$(BUILD_CMD) $(BUILD_OPTS) $(shell_target) --load -t "$(DOCKER_IMAGE)" .
.PHONY: shell
@@ -284,3 +284,10 @@ generate-files:
--file "./hack/dockerfiles/generate-files.Dockerfile" .
cp -R "$($@_TMP_OUT)"/. .
rm -rf "$($@_TMP_OUT)"/*
.PHONY: validate-bind-dir
validate-bind-dir:
@case "$(BIND_DIR)" in \
".."*|"/"*) echo "Make needs to be run from the project-root directory, with BIND_DIR set to \".\" or a subdir"; \
exit 1 ;; \
esac