Skip to content

Commit d9972cc

Browse files
authored
Fixes google-chrome not found for Mac users in Docker setup (oppia#19512)
* fix: chrome version for mac * chore: removed newlines * chore: refracted the variables name
1 parent 243ab6d commit d9972cc

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

Makefile

+13-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
SHELL := /bin/bash
22

3-
SHELL_PREFIX=docker compose exec
3+
SHELL_PREFIX = docker compose exec
4+
45
ALL_SERVICES = datastore dev-server firebase elasticsearch webpack-compiler angular-build redis
56

7+
OS_NAME := $(shell uname)
8+
69
FLAGS = save_datastore disable_host_checking no_auto_restart prod_env maintenance_mode source_maps
10+
11+
ifeq ($(OS_NAME),Darwin)
12+
CHROME_VERSION := $(shell /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version | awk '{print $$3}')
13+
else
14+
CHROME_VERSION := $(shell google-chrome --version | awk '{print $$3}')
15+
endif
16+
717
$(foreach flag, $(FLAGS), $(eval $(flag) = false))
818

919
.PHONY: help run-devserver build clean terminal stop-devserver \
10-
$(addsuffix stop., $(ALL_SERVICES)) $(addsuffix logs., $(ALL_SERVICES)) \
11-
$(addsuffix restart., $(ALL_SERVICES))
20+
$(addsuffix stop., $(ALL_SERVICES)) $(addsuffix logs., $(ALL_SERVICES)) \
21+
$(addsuffix restart., $(ALL_SERVICES))
1222

1323
echo_flags:
1424
@echo "Flags:"
@@ -143,8 +153,6 @@ run_tests.acceptance: ## Runs the acceptance tests for the parsed suite
143153
@echo '------------------------------------------------------'
144154
$(MAKE) stop
145155

146-
CHROME_VERSION := $(shell google-chrome --version | awk '{print $$3}')
147-
148156
run_tests.e2e: ## Runs the e2e tests for the parsed suite
149157
## Flags for the e2e tests
150158
## suite: The suite to run the e2e tests
@@ -220,7 +228,5 @@ run_tests.lighthouse_performance: ## Runs the lighthouse performance tests for t
220228
@echo '-----------------------------------------------------------------------'
221229
$(MAKE) stop
222230

223-
OS_NAME := $(shell uname)
224-
225231
install_node: ## Installs node-16.13.0 in the oppia_tools directory
226232
sh ./docker/install_node.sh

0 commit comments

Comments
 (0)