Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/asdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
run: cat modules/satoshi/tf-tool-versions modules/satoshi/k8s-tool-versions > .tool-versions
shell: bash
- name: setup
uses: asdf-vm/actions/setup@v2
uses: asdf-vm/actions/setup@v4
- name: plugins setup
run: grep -E "^#asdf:" '.tool-versions' | cut -d':' -f2- | tr '\n' '\0' | xargs -0 -n1 -Icmd -- sh -c 'asdf cmd' || true
- name: install
uses: asdf-vm/actions/install@v2
uses: asdf-vm/actions/install@v4
27 changes: 21 additions & 6 deletions modules/asdf/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
## asdf helpers
ASDF_ROOT := ${HOME}/.asdf
ASDF_VERSION := 0.18.0
ASDF_BIN_DIR := ${HOME}/.local/bin
ASDF_REPO_DIR=$(shell pwd)

.PHONY: asdf/install

## Installing required tools
asdf/install:
test -s $(ASDF_ROOT) || git clone https://github.com/asdf-vm/asdf.git $(ASDF_ROOT) && source $(ASDF_ROOT)/asdf.sh ;\
grep -E "^#asdf:" '${ASDF_REPO_DIR}/.tool-versions' | cut -d':' -f2- | tr '\n' '\0' | xargs -0 -n1 -Icmd -- sh -c 'asdf cmd' || true;\
@CURRENT_VER=$$(asdf version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' || echo "0.0.0"); \
if [ "$$CURRENT_VER" != "$(ASDF_VERSION)" ]; then \
echo "Upgrading asdf from $$CURRENT_VER to $(ASDF_VERSION)..."; \
rm -f $(ASDF_BIN_DIR)/asdf; \
chmod -R u+w $${HOME}/.asdf 2>/dev/null; rm -rf $${HOME}/.asdf; \
mkdir -p $(ASDF_BIN_DIR); \
curl -fsSL "https://github.com/asdf-vm/asdf/releases/download/v$(ASDF_VERSION)/asdf-v$(ASDF_VERSION)-linux-amd64.tar.gz" \
| tar -xz -C $(ASDF_BIN_DIR); \
chmod +x $(ASDF_BIN_DIR)/asdf; \
echo "Ensure $(ASDF_BIN_DIR) is in your PATH"; \
else \
echo "asdf $(ASDF_VERSION) already installed"; \
fi
@export PATH="$(ASDF_BIN_DIR):$$PATH"; \
grep -E "^#asdf:" '${ASDF_REPO_DIR}/.tool-versions' | cut -d':' -f2- | tr '\n' '\0' | xargs -0 -n1 -Icmd -- sh -c 'asdf cmd' || true; \
asdf install
echo "Profile changes are required. Add the following to your .bashrc:"
echo -e "if [ -e $HOME/.asdf ]; then\n . $HOME/.asdf/asdf.sh\n . $HOME/.asdf/completions/asdf.bash\nfi"
echo "Or see https://asdf-vm.com/guide/getting-started.html#_3-install-asdf for details"
@echo "Ensure $(ASDF_BIN_DIR) and the asdf shims directory are on your PATH."
@echo "Add the following to your shell profile:"
@echo ' export PATH="$$HOME/.asdf/shims:$$HOME/.local/bin:$$PATH"'
@echo "Or see https://asdf-vm.com/guide/getting-started.html for details"