Skip to content

Commit 6852192

Browse files
authored
Merge pull request #25326 from rayw000/makefile-update-submodules-before-serve
Add new make target `module-init` and update `module-check`
2 parents 0bf3cb6 + 57f12c3 commit 6852192

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ help: ## Show this help.
1919
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
2020

2121
module-check:
22-
@git submodule status --recursive | awk '/^[+-]/ {printf "\033[31mWARNING\033[0m Submodule not initialized: \033[34m%s\033[0m\n",$$2}' 1>&2
22+
@git submodule status --recursive | awk '/^[+-]/ {err = 1; printf "\033[31mWARNING\033[0m Submodule not initialized: \033[34m%s\033[0m\n",$$2} END { if (err != 0) print "You need to run \033[32mmake module-init\033[0m to initialize missing modules first"; exit err }' 1>&2
23+
24+
module-init:
25+
@echo "Initializing submodules..." 1>&2
26+
@git submodule update --init --recursive --depth 1
2327

2428
all: build ## Build site with production settings and put deliverables in ./public
2529

0 commit comments

Comments
 (0)