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+ #! /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