Skip to content

Instantly share code, notes, and snippets.

@marcraminv
Last active April 30, 2026 09:39
Show Gist options
  • Select an option

  • Save marcraminv/e269ae36f32bf4bd233273dbfd02c788 to your computer and use it in GitHub Desktop.

Select an option

Save marcraminv/e269ae36f32bf4bd233273dbfd02c788 to your computer and use it in GitHub Desktop.

Revisions

  1. marcraminv revised this gist Apr 30, 2026. 1 changed file with 0 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions asdf-bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -4,10 +4,7 @@ set -euo pipefail
    # ── Plugin list: "name url" (url is optional) ─────────────────────────────────
    PLUGINS=(
    "uv"
    "bun"
    "nodejs"
    "kubectl"
    "helm"
    "direnv"
    )

  2. marcraminv revised this gist Feb 21, 2026. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions asdf-bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -45,5 +45,13 @@ else
    done
    fi

    # ── Configure direnv in .zshrc ────────────────────────────────────────────────
    if ! grep -q 'direnv hook' "${HOME}/.zshrc" 2>/dev/null; then
    echo 'eval "$(direnv hook zsh)"' >> "${HOME}/.zshrc"
    echo "direnv hook added to ~/.zshrc"
    else
    echo "direnv hook already present in ~/.zshrc, skipping."
    fi

    echo ""
    echo "✅ All done!"
  3. marcraminv revised this gist Feb 21, 2026. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion asdf-bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,3 @@

    #!/usr/bin/env bash
    set -euo pipefail

  4. marcraminv created this gist Feb 21, 2026.
    50 changes: 50 additions & 0 deletions asdf-bootstrap.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,50 @@

    #!/usr/bin/env bash
    set -euo pipefail

    # ── Plugin list: "name url" (url is optional) ─────────────────────────────────
    PLUGINS=(
    "uv"
    "bun"
    "nodejs"
    "kubectl"
    "helm"
    "direnv"
    )

    # ── Add plugins ───────────────────────────────────────────────────────────────
    for entry in "${PLUGINS[@]}"; do
    plugin="${entry%% *}"
    url="${entry#* }"
    [[ "${url}" == "${plugin}" ]] && url=""

    if asdf plugin list | grep -q "^${plugin}$"; then
    echo "Plugin '${plugin}' already added, skipping."
    else
    echo "Adding plugin: ${plugin}"
    asdf plugin add "${plugin}" ${url:+"${url}"}
    fi
    done

    # ── Install tool versions ─────────────────────────────────────────────────────
    install_tool() {
    local plugin="$1"
    local version
    version=$(asdf latest "${plugin}")
    echo "Installing ${plugin} ${version}..."
    asdf install "${plugin}" "${version}"
    asdf set --home "${plugin}" "${version}"
    }

    if [[ -f ".tool-versions" ]]; then
    echo "Found .tool-versions — installing pinned versions..."
    asdf install
    else
    echo "No .tool-versions found — installing latest stable versions..."
    for entry in "${PLUGINS[@]}"; do
    install_tool "${entry%% *}"
    done
    fi

    echo ""
    echo "✅ All done!"