diff --git a/CHANGELOG.md b/CHANGELOG.md index 9574bfc..ea218c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # nystudio107/matrixfacades Change Log +## 1.0.10 - 2022.05.03 +### Changed +* Determine the separator character by checking the Docker Compose API version at runtime + ## 1.0.9 - 2022.05.02 ### Changed * Use `su-exec` for the `craft`, `composer`, and `ssh` commands from the Makefile diff --git a/Makefile b/Makefile index 5fce7fa..d82666f 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,11 @@ -CONTAINER?=$(shell basename $(CURDIR))-php-1 +# Determine the docker compose API version to determine the separator character +VERSION?=$(shell docker compose version) +ifneq (,$(findstring v2.,$(VERSION))) + SEPARATOR:=- +else + SEPARATOR:=_ +endif +CONTAINER?=$(shell basename $(CURDIR))$(SEPARATOR)php$(SEPARATOR)1 .PHONY: dev clean composer craft nuke ssh up @@ -7,10 +14,10 @@ clean: rm -f cms/composer.lock rm -rf cms/vendor/ composer: up - docker exec -it ${CONTAINER} su-exec www-data composer \ + docker exec -it $(CONTAINER) su-exec www-data composer \ $(filter-out $@,$(MAKECMDGOALS)) craft: up - docker exec -it ${CONTAINER} su-exec www-data php craft \ + docker exec -it $(CONTAINER) su-exec www-data php craft \ $(filter-out $@,$(MAKECMDGOALS)) nuke: docker-compose down -v @@ -18,9 +25,9 @@ nuke: rm -rf cms/vendor/ docker-compose up --build --force-recreate ssh: up - docker exec -it ${CONTAINER} su-exec www-data /bin/sh + docker exec -it $(CONTAINER) su-exec www-data /bin/sh up: - if [ ! "$$(docker ps -q -f name=${CONTAINER})" ]; then \ + if [ ! "$$(docker ps -q -f name=$(CONTAINER))" ]; then \ cp -n cms/example.env cms/.env; \ docker-compose up; \ fi