Created
March 13, 2026 17:40
-
-
Save BrunIF/01946febdc562ffb4e32680a519f44eb to your computer and use it in GitHub Desktop.
Install ASDF plugins
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo "🚀 ASDF Full Installation Script (Corrected)" | |
| echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | |
| echo "" | |
| # Перевірка наявності asdf | |
| if ! command -v asdf &> /dev/null; then | |
| echo "❌ asdf не встановлено!" | |
| echo "Встановіть asdf спочатку: https://asdf-vm.com/guide/fetting-started.html" | |
| exit 1 | |
| fi | |
| echo "✅ asdf $(asdf version) знайдено" | |
| echo "" | |
| # Список плагінів | |
| PLUGINS="act action-validator actionlint argocd awscli awsls bitwarden checkov eksctl fd fx fzf helm helm-docs helmfile httpie-go infracost jfrog-cli jnv jq jqp k9s krew kubectl kubectx kubent kubie pluto popeye pre-commit semgrep shellcheck shfmt steampipe stern terraform terraform-docs terragrunt tflint tfsec ttyd uv vault vultr-cli wrk xh yamllint yq" | |
| total=$(echo $PLUGINS | wc -w) | |
| current=0 | |
| echo "📦 Встановлюю та активую $total плагінів..." | |
| echo "" | |
| for plugin in $PLUGINS; do | |
| ((current++)) | |
| printf "[%2d/%2d] %-20s " "$current" "$total" "$plugin" | |
| # Крок 1: Додати плагін | |
| if ! asdf plugin list | grep -q "^${plugin}$"; then | |
| if ! asdf plugin add "$plugin" &> /dev/null; then | |
| echo "❌ помилка додавання плагіна" | |
| continue | |
| fi | |
| fi | |
| # Крок 2: Встановити latest версію | |
| printf "⬇️ " | |
| if asdf install "$plugin" latest &> /tmp/asdf-install-${plugin}.log; then | |
| # Крок 3: Отримати встановлену версію | |
| installed_version=$(asdf latest "$plugin" 2>/dev/null) | |
| if [ -n "$installed_version" ]; then | |
| # Крок 4: Активувати версію через asdf set | |
| if asdf set "$plugin" "$installed_version" &> /dev/null; then | |
| echo "✅ $installed_version" | |
| else | |
| echo "⚠️ встановлено $installed_version, але не активовано" | |
| fi | |
| else | |
| echo "✅ встановлено" | |
| fi | |
| else | |
| echo "❌ помилка встановлення (див. /tmp/asdf-install-${plugin}.log)" | |
| fi | |
| done | |
| echo "" | |
| echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | |
| echo "✅ Встановлення завершено!" | |
| echo "" | |
| echo "📝 Перевірте встановлені версії:" | |
| echo " asdf current" | |
| echo "" | |
| echo "📄 Версії збережено в .tool-versions в поточній директорії" | |
| echo " Для глобальних налаштувань використовуйте: asdf set -u <tool> <version>" | |
| echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment