Skip to content

Commit af0a9bc

Browse files
committed
#73 few cleanups in colors
1 parent 8d8cea0 commit af0a9bc

File tree

1 file changed

+36
-28
lines changed

1 file changed

+36
-28
lines changed

Makefile

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ install:
3131
printf "%s\n" "$$padding"; \
3232
printf "\e[1;34m Do you want to run the application locally or with Docker?\e[0m\n"; \
3333
printf "\e[1;33m [L] \e[0m Local - Run the application locally\n"; \
34-
printf "\e[1;33m [D] \e[0m Docker - Run the axpplication in Docker\n"; \
34+
printf "\e[1;33m [D] \e[0m Docker - Run the application in Docker\n"; \
3535
read -p " > " choice; \
3636
case "$$choice" in \
3737
[lL]) echo -e "\033[1;32m ✔ You chose: Local Setup\033[0m"; $(MAKE) setup-local ;; \
@@ -47,38 +47,46 @@ setup-local:
4747
cp .env.localhost.example .env.localhost; \
4848
fi
4949
@while true; do \
50-
printf "\n\e[1;34m Python setup environment...\e[0m"; \
50+
printf "\n\e[1;34m Python setup environment \e[0m"; \
5151
printf "\e[1;34m\n Do you want to install requirements?\e[0m\n"; \
52-
printf "\e[1;33m [y] \e[0m Yes - Install and then run application locally\n"; \
53-
printf "\e[1;33m [n] \e[0m No - Skip and run application locally \n"; \
54-
read -p " > " choice; \
55-
case "$$choice" in \
56-
[yY]) \
57-
echo -e "\033[1;32m ✔ Installing Python dependencies...\033[0m"; \
58-
$(MAKE) install-requirements; \
59-
$(MAKE) run; \
60-
break; \
61-
;; \
62-
[nN]|[sS]) \
63-
echo -e "\033[1;33m Skipping requirement installation. Starting the local server instead...\033[0m"; \
64-
$(MAKE) run; \
65-
break; \
66-
;; \
67-
*) \
68-
echo -e "\033[1;31m Invalid input: Please enter 'y', 'n', or 's' to proceed.\033[0m"; \
69-
;; \
70-
esac; \
52+
printf "\e[1;33m [Y] \e[0m Yes - Install and then run application locally\n"; \
53+
printf "\e[1;33m [N] \e[0m No - Skip and run application locally \n"; \
54+
read -p " > " choice; \
55+
case "$$choice" in \
56+
[yY]) \
57+
echo -e "\033[1;32m ✔ Installing Python dependencies...\033[0m"; \
58+
$(MAKE) install-requirements; \
59+
$(MAKE) run; \
60+
break; \
61+
;; \
62+
[nN]|[sS]) \
63+
echo -e "\033[1;32m ✔ Skipping requirement installation. Starting the local server instead...\033[0m"; \
64+
$(MAKE) run; \
65+
break; \
66+
;; \
67+
*) \
68+
echo -e "\033[1;31m Invalid input: Please enter 'y', 'n', or 's' to proceed.\033[0m"; \
69+
;; \
70+
esac; \
7171
done
7272

7373
.PHONY: install-linux
7474
install-linux:
75-
@echo -e "\033[1;34m Installing Linux dependencies...\033[0m"; \
75+
@echo -e "\033[1;32m ✔ Installing Linux dependencies...\033[0m"; \
7676
sudo apt update && sudo apt install -y libmagic1 poppler-utils pkg-config
7777

7878
.PHONY: install-macos
7979
install-macos:
80-
@echo -e "\033[1;34m Installing macOS dependencies...\033[0m"; \
81-
brew update && brew install libmagic poppler pkg-config ghostscript ffmpeg automake autoconf
80+
@commandToRun="brew update && brew install libmagic poppler pkg-config ghostscript ffmpeg automake autoconf"; \
81+
printf "\e[1;34m\n The installer will execute the following command:\n > $$commandToRun\033[0m\n"; \
82+
printf " Press \e[1;33m[ANY KEY]\e[0m to proceed with the installation, or \e[1;33m[N]\e[0m to skip (ensure these dependencies are installed manually):\n"; \
83+
read -p " > " choice; \
84+
if [ "$$choice" != "n" ] && [ "$$choice" != "N" ]; then \
85+
sh -c "$$commandToRun"; \
86+
echo -e "\033[1;32m ✔ macOS dependencies installed successfully.\033[0m"; \
87+
else \
88+
echo -e "\033[2m ➖ macOS dependency installation skipped.\033[0m"; \
89+
fi
8290

8391
.PHONY: install-requirements
8492
install-requirements:
@@ -89,7 +97,7 @@ install-requirements:
8997
.PHONY: run
9098
run:
9199
@$(call load_env,.env.localhost)
92-
@echo "Starting the local application server..."; \
100+
@printf "\033[1;32m ✔ Starting the local application server...\033[0m"; \
93101
DISABLE_VENV=$(DISABLE_VENV) DISABLE_LOCAL_OLLAMA=$(DISABLE_LOCAL_OLLAMA) ./run.sh
94102

95103
.PHONY: setup-docker
@@ -111,17 +119,17 @@ setup-docker:
111119

112120
.PHONY: run-docker
113121
run-docker:
114-
@echo -e "\033[1;34m Starting Docker container with CPU support...\033[0m";
122+
@echo -e "\033[1;32m ✔ Starting Docker container with CPU support...\033[0m";
115123
@docker-compose -f docker-compose.yml up --build
116124

117125
.PHONY: run-docker-gpu
118126
run-docker-gpu:
119-
@echo -e "\033[1;34m Starting Docker container with GPU support...\033[0m";
127+
@echo -e "\033[1;32m ✔ Starting Docker container with GPU support...\033[0m";
120128
@docker-compose -f docker-compose.gpu.yml -p text-extract-api-gpu up --build
121129

122130
.PHONY: clean
123131
clean:
124-
@echo "Cleaning project..."; \
132+
@echo "\033[1;32m ✔ Cleaning project...\033[0m"; \
125133
docker-compose down -v; \
126134
$(MAKE) clean-cache
127135

0 commit comments

Comments
 (0)