Skip to content

Commit 87a2e80

Browse files
committed
Use Makefile directives instead
1 parent 70985cf commit 87a2e80

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

symfony/framework-bundle/3.3/Makefile

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,22 @@ cache-warmup: cache-clear
66
@test -f bin/console && bin/console cache:warmup || echo "cannot warmup the cache (needs symfony/console)"
77
.PHONY: cache-warmup
88

9+
CONSOLE=bin/console
10+
$(CONSOLE):
11+
@exit
12+
13+
serve_as_sf: $(CONSOLE)
14+
@$(CONSOLE)|grep server:start > /dev/null
15+
@$(CONSOLE) server:start || exit 0
16+
17+
@echo "Quit the server with \033[32;49mbin/console server:stop.\033[39m"
18+
19+
serve_as_php:
20+
@echo "\033[32;49mServer listening on http://127.0.0.1:8000\033[39m";
21+
@echo "Quit the server with CTRL-C."
22+
@echo "Run \033[32mcomposer require symfony/web-server-bundle\033[39m for a better web server"
23+
php -S 127.0.0.1:8000 -t web
24+
925
serve:
10-
@if [ -a bin/console ] && [[ `bin/console list server | grep server:start` ]]; then \
11-
bin/console server:start; \
12-
echo -e "Quit the server with \033[32;49mbin/console server:stop.\033[39m"; \
13-
else \
14-
echo -e "\033[32;49mServer listening on http://127.0.0.1:8000\033[39m"; \
15-
echo "Quit the server with CTRL-C."; \
16-
echo -e "Run \033[32mcomposer require symfony/web-server-bundle\033[39m for a better web server"; \
17-
php -S 127.0.0.1:8000 -t web; \
18-
fi
26+
@${MAKE} serve_as_sf || ${MAKE} serve_as_php
1927
.PHONY: serve

0 commit comments

Comments
 (0)