Skip to content

Commit 88f48b4

Browse files
Updated _install-dependencies to recursively install all tool-versions files. Need to backport to nhse template
1 parent 606bbe8 commit 88f48b4

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

scripts/init.mk

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,17 @@ _install-dependency: # Install asdf dependency - mandatory: name=[listed in the
4545
asdf plugin add ${name} ||:
4646
asdf install ${name} $(or ${version},)
4747

48-
_install-dependencies: # Install all the dependencies listed in .tool-versions
49-
for plugin in $$(grep ^[a-z] .tool-versions | sed 's/[[:space:]].*//'); do
50-
make _install-dependency name="$${plugin}"
48+
# Updated to recursively install dependencies from all .tool-versions files
49+
# This is not in the repository template yet - needs a discussion and probably a backport there
50+
_install-dependencies: # Install all dependencies from all .tool-versions files in the repository
51+
@for toolfile in $$(find . -name ".tool-versions" -type f | sort); do \
52+
echo "Processing $$toolfile"; \
53+
while IFS=' ' read -r tool version; do \
54+
if [[ "$$tool" =~ ^[a-z] ]] && [[ -n "$$version" ]]; then \
55+
echo " Installing $$tool $$version"; \
56+
make _install-dependency name="$$tool" version="$$version"; \
57+
fi; \
58+
done < "$$toolfile"; \
5159
done
5260

5361
clean:: # Remove all generated and temporary files (common) @Operations

0 commit comments

Comments
 (0)