feat: Intel MacとApple Siliconの両方に対応 - #46
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
やったこと
Closes #12
背景
Apple Silicon 前提のパスがハードコードされており、Intel Mac では動作しませんでした。リポジトリ全体を調べたところ、該当は以下の 3 箇所でした。
zsh/.zshenveval "$(/opt/homebrew/bin/brew shellenv)"scripts/setup/link_dotfiles.sh/opt/homebrew/share/android-commandlinetools/...scripts/setup/android_setup.shsystem-images;...;arm64-v8aHomebrew は Apple Silicon で
/opt/homebrew、Intel で/usr/localに入ります。Android のシステムイメージも CPU に合わせてarm64-v8aとx86_64を使い分ける必要があります。変更内容
zsh/.zshenv
実際に存在する方を使います。
brew --prefixは brew 自体に PATH が通っていないと使えないため、パスの存在確認で判定しています。scripts/setup/link_dotfiles.sh / scripts/setup/android_setup.sh
uname -mで判定します。link_dotfiles.shはsetup.shの最初に実行され、この時点では Homebrew 未インストールの可能性があるため、brew に依存しない判定にしています。動作確認
unameを差し替えて、両アーキテクチャでの分岐を確認しました。.zshenvは brew の配置を変えた 3 パターンで確認しました。3 つ目は今回の副次的な改善です。従来は brew が無いと
no such file or directoryが出ていましたが、分岐を入れたことで無害に通過するようになりました。あわせて以下も確認しています。
zsh -nの構文チェックを通過(3 ファイルとも)/opt/homebrewとarm64-v8aのハードコードが、分岐の内側以外に残っていないこと補足
手元が Apple Silicon のため、Intel 実機での通しの動作確認はできていません。分岐ロジックは上記の通り両方で検証済みですが、実機での確認は必要に応じてお願いします。
🤖 Generated with Claude Code