AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
simplified the install script add help instruction
SwiftyOS3ea9d6a70f36
diff --git a/cli.py b/cli.pyindex 9c67f10f30..16eb0d469e 100644--- a/cli.py+++ b/cli.py@@ -45,15 +45,23 @@ d88P 888 "Y88888 "Y888 "Y88P" "Y8888P88 888 888script_dir = os.path.dirname(os.path.realpath(__file__))setup_script = os.path.join(script_dir, "setup.sh")+ install_error = Falseif os.path.exists(setup_script):click.echo(click.style("π Setup initiated...\n", fg="green"))- subprocess.Popen([setup_script], cwd=script_dir)+ try:+ subprocess.check_call([setup_script], cwd=script_dir)+ except subprocess.CalledProcessError:+ click.echo(+ click.style("β There was an issue with the installation.", fg="red")+ )+ install_error = Trueelse:click.echo(click.style("β Error: setup.sh does not exist in the current directory.", fg="red"))+ install_error = Truetry:# Check if GitHub user name is configured@@ -99,7 +107,8 @@ d88P 888 "Y88888 "Y888 "Y88P" "Y8888P88 888 888' git config --global user.email "Your GitHub Email"', fg="red"))-+ install_error = True+ print_access_token_instructions = False# Check for the existence of the .github_access_token fileif os.path.exists(".github_access_token"):with open(".github_access_token", "r") as file:@@ -125,6 +134,7 @@ d88P 888 "Y88888 "Y888 "Y88P" "Y8888P88 888 888))else:+ install_error = Trueclick.echo(click.style("β GitHub access token does not have the required permissions. Please ensure it has 'public_repo' or 'repo' scope.",@@ -132,6 +142,7 @@ d88P 888 "Y88888 "Y888 "Y88P" "Y8888P88 888 888))else:+ install_error = Trueclick.echo(click.style("β Failed to validate GitHub access token. Please ensure it is correct.",@@ -139,17 +150,22 @@ d88P 888 "Y88888 "Y888 "Y88P" "Y8888P88 888 888))else:+ install_error = Trueclick.echo(click.style("β GitHub access token file is empty. Please follow the instructions below to set up your GitHub access token.",fg="red",))+ print_access_token_instructions = Trueelse:# Create the .github_access_token file if it doesn't existwith open(".github_access_token", "w") as file:file.write("")+ install_error = True+ print_access_token_instructions = True+ if print_access_token_instructions:# Instructions to set up GitHub access tokenclick.echo(click.style(@@ -178,6 +194,14 @@ d88P 888 "Y88888 "Y888 "Y88P" "Y8888P88 888 888click.echo(click.style("\t9. Save the file and run the setup command again.", fg="red"))+ if install_error:+ click.echo(+ click.style(+ "\n\nπ΄ If you need help, please raise a ticket on GitHub at https://github.com/Significant-Gravitas/Auto-GPT/issues\n\n",+ fg="magenta",+ bold=True,+ )+ )@cli.group()diff --git a/setup.sh b/setup.shindex 20716650ce..f7020831e6 100755--- a/setup.sh+++ b/setup.sh@@ -24,30 +24,31 @@ fiif ! command -v flutter &> /dev/nullthenecho "flutter could not be found"- echo "Installing flutter..."- git clone https://github.com/flutter/flutter.git- export PATH="$PATH:`pwd`/flutter/bin"+ echo "Please install flutter following the instrutions found at https://docs.flutter.dev/get-started/install"+ exit 1fiif [[ "$OSTYPE" == "linux-gnu"* ]]; thenif ! command -v google-chrome-stable &> /dev/nullthenecho "Google Chrome could not be found"- echo "Installing Google Chrome..."- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb- sudo dpkg -i google-chrome-stable_current_amd64.deb+ echo "Please install Google Chrome manually from https://www.google.com/chrome/"+ exit 1fielif [[ "$OSTYPE" == "darwin"* ]]; thenif ! command -v /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome &> /dev/nullthenecho "Google Chrome could not be found"echo "Please install Google Chrome manually from https://www.google.com/chrome/"+ exit 1fielif [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "win32" ]]; thenif ! command -v /c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe &> /dev/nullthenecho "Google Chrome could not be found"echo "Please install Google Chrome manually from https://www.google.com/chrome/"+ exit 1fielseecho "Unsupported OS. Please install Google Chrome manually from https://www.google.com/chrome/"+ exit 1fi