diff --git a/.gitignore b/.gitignore index da94aa7..2900119 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,9 @@ local.* ### ssh ### -.ssh \ No newline at end of file +.ssh + +### ASDF ### +/asdf/* +!/asdf/.tool-versions +!/asdf/plugins.txt diff --git a/asdf/.tool-versions b/asdf/.tool-versions new file mode 100644 index 0000000..92efda0 --- /dev/null +++ b/asdf/.tool-versions @@ -0,0 +1,10 @@ +ruby 3.3.4 +awscli 2.16.5 +flutter 3.29.2-stable +gradle 8.4 +java openjdk-17.0.2 +nodejs 20.12.2 +pre-commit 3.7.1 +yarn 1.22.22 +kotlin 2.1.10 +rust 1.85.1 diff --git a/asdf/plugins.txt b/asdf/plugins.txt new file mode 100644 index 0000000..95bda4c --- /dev/null +++ b/asdf/plugins.txt @@ -0,0 +1,10 @@ +awscli https://github.com/MetricMike/asdf-awscli.git +flutter https://github.com/oae/asdf-flutter.git +gradle https://github.com/rfrancis/asdf-gradle.git +java https://github.com/halcyon/asdf-java.git +kotlin https://github.com/asdf-community/asdf-kotlin.git +nodejs https://github.com/asdf-vm/asdf-nodejs.git +pre-commit https://github.com/jonathanmorley/asdf-pre-commit.git +ruby https://github.com/asdf-vm/asdf-ruby.git +rust https://github.com/code-lever/asdf-rust.git +yarn https://github.com/twuni/asdf-yarn.git diff --git a/scripts/asdf_setup.sh b/scripts/asdf_setup.sh new file mode 100644 index 0000000..0d19ed7 --- /dev/null +++ b/scripts/asdf_setup.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env zsh +set -euo pipefail + +echo "「ASDF」のセットアップを開始しました" + +# プラグインを出力 +asdf plugin list --urls > ~/dotfiles/asdf/plugins.txt + +# プラグインをインストール +while read -r name url; do + asdf plugin add "$name" "$url" || true +done < ~/dotfiles/asdf/plugins.txt + +# 一括インストール +asdf install + +echo "「ASDF」のセットアップが完了しました" diff --git a/scripts/setup.sh b/scripts/setup.sh index 42734b4..2f46ae3 100644 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -6,5 +6,5 @@ echo "「dotfiles」のセットアップを開始しました" INSTALL_DIR="$HOME/dotfiles" sh "$INSTALL_DIR/scripts/homebrew_setup.sh" - +sh "$INSTALL_DIR/scripts/asdf_setup.sh" echo "「dotfiles」のセットアップが完了しました" diff --git a/zsh/.zshenv b/zsh/.zshenv index 613f562..aab8806 100644 --- a/zsh/.zshenv +++ b/zsh/.zshenv @@ -1,2 +1,8 @@ # Homebrew eval "$(/opt/homebrew/bin/brew shellenv)" + +# ASDF +export ASDF_DATA_DIR="$HOME/dotfiles/asdf" +export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH" +fpath=(${ASDF_DATA_DIR:-$HOME/.asdf}/completions $fpath) +autoload -Uz compinit && compinit