From 0dc5ffd01cfd621b4cb6830d5ab77a9031c802b0 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 5 Jun 2024 22:29:02 +0200 Subject: asdf experiment --- .settings.sh | 3 +++ bin/asdf | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100755 bin/asdf diff --git a/.settings.sh b/.settings.sh index 020dcbd..38b5e20 100644 --- a/.settings.sh +++ b/.settings.sh @@ -8,6 +8,9 @@ export ANSIBLE_CONFIG=$basedir/ansible/ansible.cfg echo "Adding bin/ to path" PATH="$basedir/bin:$PATH" +#echo "Adding bin/.tmp/asdf-data/shims/ to path" +#PATH="$basedir/bin/.tmp/asdf-data/shims:$PATH" + if [[ ! -r .vault ]] then echo "Missing .vault" diff --git a/bin/asdf b/bin/asdf new file mode 100755 index 0000000..aa36c16 --- /dev/null +++ b/bin/asdf @@ -0,0 +1,23 @@ +#!/bin/bash + +set -euo pipefail + +v="0.14.0" + +basedir="${0%/*}" +self="${0##*/}" + +url="https://github.com/asdf-vm/asdf/archive/refs/tags/v$v.tar.gz" +dir="$basedir/.tmp" +bin="$dir/$self-$v/bin/$self" + +if [ ! -x "$bin" ] +then + rm -rf "$dir" + mkdir -p "${dir}" + curl -L "$url" | tar xfz - -C $dir +fi + +export ASDF_DATA_DIR="$dir/asdf-data" + +exec "$bin" "${@}" -- cgit v1.2.3