We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent db80681 commit dd44df6Copy full SHA for dd44df6
1 file changed
install.sh
@@ -71,11 +71,26 @@ case "$os" in
71
esac
72
73
if [ -z "$PREFIX" ]; then
74
- if [ "$(id -u)" -eq 0 ]; then
75
- PREFIX="/usr/local/bin"
76
- else
77
- PREFIX="${HOME}/.local/bin"
78
- fi
+ case "$os" in
+ Darwin)
+ if [ -d "/opt/homebrew/bin" ] && [ -w "/opt/homebrew/bin" ]; then
+ PREFIX="/opt/homebrew/bin"
+ elif [ -d "/usr/local/bin" ] && [ -w "/usr/local/bin" ]; then
79
+ PREFIX="/usr/local/bin"
80
+ elif [ "$(id -u)" -eq 0 ]; then
81
82
+ else
83
+ PREFIX="${HOME}/.local/bin"
84
+ fi
85
+ ;;
86
+ *)
87
+ if [ "$(id -u)" -eq 0 ]; then
88
89
90
91
92
93
+ esac
94
fi
95
96
mkdir -p "$PREFIX"
0 commit comments