updated checks
parent
54f1098dcf
commit
8958f58eca
12
cli.py
12
cli.py
|
@ -132,7 +132,9 @@ def create(agent_name):
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
new_agent_dir = f'./autogpts/{agent_name}'
|
new_agent_dir = f'./autogpts/{agent_name}'
|
||||||
if not os.path.exists(new_agent_dir):
|
agent_json_file = f'./arena/{agent_name}.json'
|
||||||
|
|
||||||
|
if not os.path.exists(new_agent_dir) and not os.path.exists(agent_json_file):
|
||||||
shutil.copytree('./autogpts/forge', new_agent_dir)
|
shutil.copytree('./autogpts/forge', new_agent_dir)
|
||||||
click.echo(click.style(f"🎉 New agent '{agent_name}' created. The code for your new agent is in: autogpts/{agent_name}", fg='green'))
|
click.echo(click.style(f"🎉 New agent '{agent_name}' created. The code for your new agent is in: autogpts/{agent_name}", fg='green'))
|
||||||
click.echo(click.style(f"🚀 If you would like to enter the arena, run './run arena enter {agent_name}'", fg='yellow'))
|
click.echo(click.style(f"🚀 If you would like to enter the arena, run './run arena enter {agent_name}'", fg='yellow'))
|
||||||
|
@ -495,11 +497,7 @@ def submit(agent_name, branch):
|
||||||
click.echo(click.style(f"❌ The directory for agent '{agent_name}' does not exist in the autogpts directory.", fg='red'))
|
click.echo(click.style(f"❌ The directory for agent '{agent_name}' does not exist in the autogpts directory.", fg='red'))
|
||||||
click.echo(click.style(f"🚀 Run './run agents create {agent_name}' to create the agent. Then you can enter the arena with ./run arena enter", fg='yellow'))
|
click.echo(click.style(f"🚀 Run './run agents create {agent_name}' to create the agent. Then you can enter the arena with ./run arena enter", fg='yellow'))
|
||||||
return
|
return
|
||||||
else:
|
|
||||||
# Check if the agent has already entered the arena
|
|
||||||
if not os.path.exists(f'arena/{agent_name}.json'):
|
|
||||||
click.echo(click.style(f"❌ The agent '{agent_name}' has not yet entered the arena. Please enter the arena with './run arena enter'", fg='red'))
|
|
||||||
return
|
|
||||||
|
|
||||||
# Check if there are staged changes
|
# Check if there are staged changes
|
||||||
staged_changes = [line for line in subprocess.check_output(['git', 'status', '--porcelain']).decode('utf-8').split('\n') if line and line[0] in ('A', 'M', 'D', 'R', 'C')]
|
staged_changes = [line for line in subprocess.check_output(['git', 'status', '--porcelain']).decode('utf-8').split('\n') if line and line[0] in ('A', 'M', 'D', 'R', 'C')]
|
||||||
|
@ -507,8 +505,6 @@ def submit(agent_name, branch):
|
||||||
click.echo(click.style(f"❌ There are staged changes. Please commit or stash them and run the command again.", fg='red'))
|
click.echo(click.style(f"❌ There are staged changes. Please commit or stash them and run the command again.", fg='red'))
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Load GitHub access token from file
|
# Load GitHub access token from file
|
||||||
with open('.github_access_token', 'r') as file:
|
with open('.github_access_token', 'r') as file:
|
||||||
|
|
Loading…
Reference in New Issue