Skip to content

Commit

Permalink
use vars
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartManoj committed Aug 11, 2024
1 parent f8e0fee commit 71475ca
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down

0 comments on commit 71475ca

Please sign in to comment.