环境

```zsh
#!/bin/zsh

declare -A TOOLS=(
[goland]="/Volumes/RedmibookOrigin/softwares/JetBrains/GoLand.app/Contents/MacOS/goland"
# [idea]="/path/to/IntelliJ IDEA.app/Contents/MacOS/idea"
# [pycharm]="/path/to/PyCharm.app/Contents/MacOS/pycharm"
)

for cmd in "${(@k)TOOLS}"; do
exe="${TOOLS[$cmd]}"
if [[ ! -f "$exe" ]]; then
echo "Skip $cmd: executable not found"
continue
fi

if command -v "$cmd" &>/dev/null; then
if "$cmd" --version &>/dev/null || \
"$cmd" --help &>/dev/null || \
"$cmd" -h &>/dev/null; then
echo "cmd usable: $cmd"
continue
fi
fi

echo "Linking $cmd → $exe"
sudo ln -sf "$exe" "/usr/local/bin/$cmd"
done```