今までも dotfiles と Brewfile を Github に置いて環境構築手順を整えていたが、 dotfiles は homesick、 Brewfile は homebrew-file というのを使っていたため管理がややこしくなっていた。
しかもそれらは全然 commit してなくて古くなってしまったため、エイヤで色々整えることにした。
Brewfile
homebrew-file を使うのはやめ、素の Brewfile を Github で管理するようにした。
下記コマンドで Brewfile を吐き出すことができる。
$ brew bundle dump --force
次回 brew のセットアップをするときは下記コマンドでいける、はず(試してないので本当にいけるかわからない…)。
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" $ git clone git@github.com:starhoshi/Brewfile.git $ brew tap Homebrew/bundle $ brew bundle --file=Brewfile/Brewfile
dotfiles
必要な設定ファイルをレポジトリ管理するようにした。karabiner, hammerspoon の設定ファイルは実際には dotfile ではないかもしれないが、難しいことを考えるのはやめた。
これらの設定ファイルは↓のコマンドで install できる、はず。
zsh がすでに install されているのが前提なので、 brew の後に実行する必要がある。
$ git clone git@github.com:starhoshi/dotfiles.git $ ./dotfiles/install.sh
dotfiles の設定では Deploy と Initialize を分けろとあるが「そこまでガチ勢じゃないしこのままでいいか」と思い, install.sh すればいい感じになるようにした。
まとめると
次回のセットアップでは、
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" $ git clone git@github.com:starhoshi/Brewfile.git $ brew tap Homebrew/bundle $ brew bundle --file=Brewfile/Brewfile $ git clone git@github.com:starhoshi/dotfiles.git $ ./dotfiles/install.sh
これで環境が整うようになった。