File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44```
55$ curl -sL https://github.com/dev-satoshi/dotfiles/install.sh | sh
66```
7+
8+ ## Update
9+ ```
10+ $ curl -sL https://github.com/dev-satoshi/dotfiles/update.sh | sh
11+ ```
Original file line number Diff line number Diff line change 1- ruby 3.3.4
21awscli 2.16.5
32flutter 3.29.2-stable
43gradle 8.4
54java openjdk-17.0.2
5+ kotlin 2.1.10
66nodejs 20.12.2
77pre-commit 3.7.1
8- yarn 1.22.22
9- kotlin 2.1.10
8+ ruby 3.3.4
109rust 1.85.1
10+ yarn 1.22.22
Original file line number Diff line number Diff line change @@ -3,15 +3,24 @@ set -euo pipefail
33
44echo " 「ASDF」のセットアップを開始しました"
55
6- # プラグインを出力
7- asdf plugin list --urls > ~ /dotfiles/asdf/plugins.txt
8-
96# プラグインをインストール
10- while read -r name url; do
11- asdf plugin add " $name " " $url " || true
7+ while IFS= $' \t ' read -r name url; do
8+ asdf plugin add " $name " " $url " > /dev/null 2>&1 || true
129done < ~ /dotfiles/asdf/plugins.txt
1310
14- # 一括インストール
15- asdf install
11+ # .tool-versionsに書いてある全てのバージョンをインストール
12+ while IFS= read -r line; do
13+ # 空行スキップ
14+ [[ -z " $line " ]] && continue
15+
16+ # 先頭の単語がプラグイン名、残りがバージョン一覧
17+ set -- " $line "
18+ plugin=$1
19+ shift
20+ for version in " $@ " ; do
21+ echo " → Installing $plugin $version "
22+ asdf install " $plugin " " $version "
23+ done
24+ done < ~ /dotfiles/asdf/.tool-versions
1625
1726echo " 「ASDF」のセットアップが完了しました"
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env zsh
2+ set -euo pipefail
3+
4+ echo " 「ASDF」のアップデートを開始しました"
5+
6+ # プラグインを出力
7+ asdf plugin list --urls > " $HOME /dotfiles/asdf/plugins.txt"
8+
9+ # 出力先ディレクトリがなければ作成
10+ mkdir -p " $HOME /dotfiles/asdf"
11+
12+ # .tool-versionsを初期化
13+ : > " $HOME /dotfiles/asdf/.tool-versions"
14+
15+ # 各プラグインの全バージョンを取得して出力
16+ for plugin in $( asdf plugin list) ; do
17+ # 空行はスキップ
18+ [[ -z " $plugin " ]] && continue
19+
20+ # バージョンリスト取得&整形(行頭の空白、*、空行を削除)
21+ versions=$( asdf list " $plugin " 2> /dev/null \
22+ | sed -e ' s/^[[:space:]]*\*\?[[:space:]]*//' -e ' /^$/d' )
23+
24+ # それぞれのバージョンを.tool-versionsに出力
25+ for version in $versions ; do
26+ echo " $plugin $version " >> " $HOME /dotfiles/asdf/.tool-versions"
27+ done
28+ done
29+
30+ echo " 「ASDF」のアップデートが完了しました"
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env zsh
2+ set -euo pipefail
3+
4+ echo " 「dotfiles」のアップデートを開始しました"
5+
6+ INSTALL_DIR=" $HOME /dotfiles"
7+
8+ sh " $INSTALL_DIR /scripts/update/asdf_update.sh"
9+
10+ echo " 「dotfiles」のアップデートが完了しました"
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env zsh
2+ set -euo pipefail
3+
4+ INSTALL_DIR=" $HOME /dotfiles"
5+
6+ if [ ! -d " $INSTALL_DIR " ]; then
7+ echo " dotfiles not found in $INSTALL_DIR "
8+ echo " Please run 'install.sh' first."
9+ exit 1
10+ fi
11+
12+ echo " Updating dotfiles..."
13+ git -C " $INSTALL_DIR " pull
14+
15+ sh " $INSTALL_DIR /scripts/update/update.sh"
You can’t perform that action at this time.
0 commit comments