aboutcode-org / typecode

7 stars 9 forks source link

Add support for finding `libmagic` install by brew on Apple Silicon #24

Open tdruez opened 2 years ago

tdruez commented 2 years ago

From https://github.com/Homebrew/brew/blob/master/docs/Installation.md#installation

This script installs Homebrew to its preferred prefix (/usr/local for macOS Intel, /opt/homebrew for Apple Silicon and /home/linuxbrew/.linuxbrew for Linux)

We only need to add a glob after https://github.com/nexB/typecode/blob/main/src/typecode/magic2.py#L128

glob.glob('/opt/homebrew/Cellar/libmagic/*/lib/libmagic.dylib')