File tree Expand file tree Collapse file tree 1 file changed +25
-3
lines changed
Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -125,9 +125,31 @@ rm -rf "$TMP_DIR"
125125# Check if installed binary is accessible
126126if ! command -v copilot > /dev/null 2>&1 ; then
127127 echo " "
128- echo " Warning: $INSTALL_DIR is not in your PATH"
129- echo " Add it to your PATH by adding this line to your shell profile:"
130- echo " export PATH=\"\$ PATH:$INSTALL_DIR \" "
128+ echo " Notice: $INSTALL_DIR is not in your PATH"
129+ export PATH=" $PATH :$INSTALL_DIR "
130+ echo " ✓ Added $INSTALL_DIR to PATH for this session"
131+
132+ # Detect shell rc file
133+ case " $( basename " ${SHELL:-/ bin/ sh} " ) " in
134+ zsh) RC_FILE=" $HOME /.zshrc" ;;
135+ bash)
136+ if [ -f " $HOME /.bash_profile" ]; then
137+ RC_FILE=" $HOME /.bash_profile"
138+ else
139+ RC_FILE=" $HOME /.bashrc"
140+ fi
141+ ;;
142+ * ) RC_FILE=" $HOME /.profile" ;;
143+ esac
144+
145+ # Prompt user to add to shell rc file
146+ echo " "
147+ printf " Would you like to add it to %s? [y/N] " " $RC_FILE "
148+ read -r REPLY < /dev/tty
149+ if [ " $REPLY " = " y" ] || [ " $REPLY " = " Y" ]; then
150+ echo " export PATH=\"\$ PATH:$INSTALL_DIR \" " >> " $RC_FILE "
151+ echo " ✓ Added PATH export to $RC_FILE "
152+ fi
131153fi
132154
133155echo " "
You can’t perform that action at this time.
0 commit comments