mirror of
https://github.com/samsonjs/csc360-a1-shell.git
synced 2026-03-25 08:45:52 +00:00
17 lines
489 B
Bash
Executable file
17 lines
489 B
Bash
Executable file
#!/bin/sh
|
|
|
|
if [[ $(uname -s) = Darwin ]]; then
|
|
if command -v brew >/dev/null 2>/dev/null; then
|
|
echo $(brew --prefix)/opt
|
|
elif [[ -x /opt/homebrew/bin/brew ]]; then
|
|
echo $(/opt/homebrew/bin/brew -- prefix)/opt
|
|
elif [[ -x $HOME/homebrew/bin/brew ]]; then
|
|
echo $($HOME/homebrew/bin/brew --prefix)/opt
|
|
elif [[ -x /usr/local/bin/brew ]]; then
|
|
echo $(/usr/local/bin/brew --prefix)/opt
|
|
else
|
|
echo /usr/local
|
|
fi
|
|
else
|
|
echo /usr
|
|
fi
|