From 2e3153294a265169a868ae0ca6385c93a2f4822a Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Thu, 17 Oct 2024 05:22:36 +0200 Subject: [PATCH] build(Makefile): abort with error when trying to start another singleton service --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 147f04a1a..f2df08fb3 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,6 @@ export UNIWORXDB_OPTS ?= -cf export CONTAINER_ID export FRADRIVE_SERVICE -# TODO: to be deprecated export DEV_PORT_HTTP export DEV_PORT_HTTPS export HOOGLE_PORT @@ -377,7 +376,6 @@ start-frontend: WATCH = false # HELP(start-backend): serve yesod development site # HELP(start-frontend): start frontend watcher. Watches frontend source files for changes and recompiles on change. (TODO: watcher functionality currently broken!) # HELP(start-hoogle): serve local hoogle instance -# TODO: abort with error if a singleton service is already running start-%: FRADRIVE_SERVICE = % start-%: PORTS = $(foreach PORT,$(BASE_PORTS),$(shell utils/next_free_port.pl $(PORT))) start-%: --develop @@ -386,6 +384,10 @@ start-%: --develop echo "DEV $(DEVELOP)" if [[ "$(SINGLETON)" = "true" ]]; then \ CONTAINER_FILE=$(DEVELOP)/$* ; \ + if ! [[ -e $${CONTAINER_FILE} ]]; then \ + >&2 echo "Another $* service is already running! Use \"make new-develop\" or \"make start\" to start a new develop instance despite currently running services." ; \ + exit 1 ; \ + fi \ else \ DEVDIR=$(DEVELOP)/$*; \ I=`ls $${DEVDIR} | sort -n | tail -n1`; \