aboutsummaryrefslogtreecommitdiff
path: root/cli.py
diff options
context:
space:
mode:
authorGravatar SwiftyOS <craigswift13@gmail.com> 2023-09-15 20:09:18 +0200
committerGravatar SwiftyOS <craigswift13@gmail.com> 2023-09-15 20:09:18 +0200
commit71cb72b3a4e0881a8f163028b650abe7306fe4dd (patch)
treef544e0c0ada7dc6c2adadd256bcbbaabbcf6f178 /cli.py
parentAdded checks and templates to cli (diff)
downloadAuto-GPT-71cb72b3a4e0881a8f163028b650abe7306fe4dd.tar.gz
Auto-GPT-71cb72b3a4e0881a8f163028b650abe7306fe4dd.tar.bz2
Auto-GPT-71cb72b3a4e0881a8f163028b650abe7306fe4dd.zip
changed to check if there are staged changes
Diffstat (limited to 'cli.py')
-rw-r--r--cli.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/cli.py b/cli.py
index 2f6920e12..006d6fe3a 100644
--- a/cli.py
+++ b/cli.py
@@ -399,12 +399,13 @@ def enter(agent_name, branch):
click.echo(click.style(f"⚠️ The agent '{agent_name}' has already entered the arena. Use './run arena submit' to update your submission.", fg='yellow'))
return
- # Check if there are uncommitted changes
+ # Check if there are staged or unstaged changes
changes = subprocess.check_output(['git', 'status', '--porcelain']).decode('utf-8').strip()
if changes:
- click.echo(click.style(f"❌ There are uncommitted changes. Please commit or stash them and run the command again.", fg='red'))
+ click.echo(click.style(f"❌ There are staged or unstaged changes. Please commit or unstage them and run the command again.", fg='red'))
return
+
try:
# Load GitHub access token from file
with open('.github_access_token', 'r') as file:
@@ -499,11 +500,12 @@ def submit(agent_name, branch):
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 uncommitted changes
+ # Check if there are staged or unstaged changes
changes = subprocess.check_output(['git', 'status', '--porcelain']).decode('utf-8').strip()
if changes:
- click.echo(click.style(f"❌ There are uncommitted changes. Please commit or stash them and run the command again.", fg='red'))
+ click.echo(click.style(f"❌ There are staged or unstaged changes. Please commit or unstage them and run the command again.", fg='red'))
return
+
try:
# Load GitHub access token from file