We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9a0d581 + 10fc284 commit 894b48fCopy full SHA for 894b48f
1 file changed
install.sh
@@ -151,11 +151,19 @@ if ! command -v copilot >/dev/null 2>&1; then
151
echo ""
152
echo "Notice: $INSTALL_DIR is not in your PATH"
153
154
- # Detect shell rc file
+ # Detect shell profile file for PATH
155
case "$(basename "${SHELL:-/bin/sh}")" in
156
- zsh) RC_FILE="$HOME/.zshrc" ;;
157
- bash) RC_FILE="$HOME/.bashrc" ;;
158
- *) RC_FILE="$HOME/.profile" ;;
+ zsh) RC_FILE="${ZDOTDIR:-$HOME}/.zprofile" ;;
+ bash)
+ if [ -f "$HOME/.bash_profile" ]; then
159
+ RC_FILE="$HOME/.bash_profile"
160
+ elif [ -f "$HOME/.bash_login" ]; then
161
+ RC_FILE="$HOME/.bash_login"
162
+ else
163
+ RC_FILE="$HOME/.profile"
164
+ fi
165
+ ;;
166
+ *) RC_FILE="$HOME/.profile" ;;
167
esac
168
169
# Prompt user to add to shell rc file (only if interactive)
0 commit comments