From 71475cacfc575b17a56bea1d2d0aee9baeebcbe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=AE=AE=E0=AE=A9=E0=AF=8B=E0=AE=9C=E0=AF=8D=E0=AE=95?= =?UTF-8?q?=E0=AF=81=E0=AE=AE=E0=AE=BE=E0=AE=B0=E0=AF=8D=20=E0=AE=AA?= =?UTF-8?q?=E0=AE=B4=E0=AE=A9=E0=AE=BF=E0=AE=9A=E0=AF=8D=E0=AE=9A=E0=AE=BE?= =?UTF-8?q?=E0=AE=AE=E0=AE=BF?= Date: Sun, 11 Aug 2024 12:18:04 +0530 Subject: [PATCH] use vars --- Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8812855c3e0..a2d91d3527a 100644 --- a/Makefile +++ b/Makefile @@ -286,10 +286,16 @@ clean: @rm -rf opendevin/.cache @echo "$(GREEN)Caches cleaned up successfully.$(RESET)" -# Kill all processes on port 3000 and 3001 +# Kill all processes on port BACKEND_PORT and FRONTEND_PORT kill: - @echo "$(YELLOW)Killing all processes on port 3000 and 3001$(RESET)" - @kill -9 $$(lsof -t -i:3000) $$(lsof -t -i:3001) + @echo "$(YELLOW)Killing all processes on port $(BACKEND_PORT) and $(FRONTEND_PORT)...$(RESET)" + ports=$$(lsof -t -i:$(BACKEND_PORT) -i:$(FRONTEND_PORT)); \ + if [ -n "$$ports" ]; then \ + kill -9 $$ports; \ + echo "$(GREEN)Processes killed successfully.$(RESET)"; \ + else \ + echo "$(BLUE)No processes found on port $(BACKEND_PORT) and $(FRONTEND_PORT).$(RESET)"; \ + fi # Help help: @echo "$(BLUE)Usage: make [target]$(RESET)"