aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2024-06-05 22:29:02 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2024-06-05 22:29:02 +0200
commit0dc5ffd01cfd621b4cb6830d5ab77a9031c802b0 (patch)
tree8334157c50e23ca4355a3c344e4c97efb2a500e5
parent0beb51381519c62e1882acdc37ed3c2b2873b020 (diff)
downloadinfra-0dc5ffd01cfd621b4cb6830d5ab77a9031c802b0.tar.gz
infra-0dc5ffd01cfd621b4cb6830d5ab77a9031c802b0.tar.bz2
infra-0dc5ffd01cfd621b4cb6830d5ab77a9031c802b0.tar.xz
infra-0dc5ffd01cfd621b4cb6830d5ab77a9031c802b0.zip
asdf experiment
-rw-r--r--.settings.sh3
-rwxr-xr-xbin/asdf23
2 files changed, 26 insertions, 0 deletions
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" "${@}"