Skip to content

syntax error near unexpected token `else' solve #135

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 1 addition & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi

# Check dependencies
if type curl &>/dev/null; then
echo "" &>/dev/null
Expand Down Expand Up @@ -54,31 +55,27 @@ if [ "$answer" == "Yes" ] || [ "$answer" == "yes" ] || [ "$answer" == "y" ] || [
read -p "Please enter your OpenAI API key: " key

# Adding OpenAI key to shell profile
# zsh profile
if [ -f ~/.zprofile ]; then
echo "export OPENAI_KEY=$key" >>~/.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
# zshrc profile for debian
elif [ -f ~/.zshrc ]; then
echo "export OPENAI_KEY=$key" >>~/.zshrc
if [[ ":$PATH:" == *":/usr/local/bin:"* ]]; then
echo 'export PATH=$PATH:/usr/local/bin' >>~/.zshrc
fi
echo "OpenAI key and chatgpt path added to ~/.zshrc"
source ~/.zshrc
# bash profile mac
elif [ -f ~/.bash_profile ]; then
echo "export OPENAI_KEY=$key" >>~/.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
if [[ ":$PATH:" != *":/usr/local/bin:"* ]]; then
Expand Down