macOS(M4 / Apple Silicon)手动安装 tree(不用 brew / ports)
1️⃣ 安装编译工具(只需一次)
bash
xcode-select --install
2️⃣ 拉取 tree 源码
bash
git clone https://github.com/Old-Man-Programmer/tree.git
cd tree
3️⃣ 编译
bash
make

⚠️ 编译过程中会看到大量
warning
全部可以忽略,不影响使用 (老 C 代码 + 新 clang)
4️⃣ 安装到系统路径
bash
sudo cp tree /usr/local/bin
/usr/local/bin在 macOS 上默认在 PATH 中Apple Silicon 也没问题
5️⃣ 验证
bash
tree --version
示例输出(类似):
text
tree v2.x.x (c) 1996 - 2024 by Steve Baker, Thomas Moore, Francesc Rocher, Florian Sesser, Kyosuke Tokoro
