Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only prepend /usr/local/bin to $PATH if its not already there. #64

Merged
merged 2 commits into from
Mar 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,25 @@ if [ "$answer" == "Yes" ] || [ "$answer" == "yes" ] || [ "$answer" == "y" ] || [
# zsh profile
if [ -f ~/.zprofile ]; then
echo "export OPENAI_KEY=$key" >>~/.zprofile
echo 'export PATH=$PATH:/usr/local/bin' >>~/.zprofile
if [[ ":$PATH:" != *":/usr/local/bin:"* ]]; then
echo 'export PATH=$PATH:/usr/local/bin' >>~/.zprofile
fi
echo "OpenAI key and chatgpt path added to ~/.zprofile"
source ~/.zprofile
# bash profile mac
elif [ -f ~/.bash_profile ]; then
echo "export OPENAI_KEY=$key" >>~/.bash_profile
echo 'export PATH=$PATH:/usr/local/bin' >>~/.bash_profile
if [[ ":$PATH:" != *":/usr/local/bin:"* ]]; then
echo 'export PATH=$PATH:/usr/local/bin' >>~/.bash_profile
fi
echo "OpenAI key and chatgpt path added to ~/.bash_profile"
source ~/.bash_profile
# profile ubuntu
elif [ -f ~/.profile ]; then
echo "export OPENAI_KEY=$key" >>~/.profile
echo 'export PATH=$PATH:/usr/local/bin' >>~/.profile
if [[ ":$PATH:" != *":/usr/local/bin:"* ]]; then
echo 'export PATH=$PATH:/usr/local/bin' >>~/.profile
fi
echo "OpenAI key and chatgpt path added to ~/.profile"
source ~/.profile
else
Expand Down