mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-17 14:04:27 +01:00
change to check for only staged changes
This commit is contained in:
18
cli.py
18
cli.py
@@ -399,13 +399,14 @@ 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'))
|
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
|
return
|
||||||
|
|
||||||
# Check if there are staged or unstaged changes
|
# Check if there are staged changes
|
||||||
changes = subprocess.check_output(['git', 'status', '--porcelain']).decode('utf-8').strip()
|
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')]
|
||||||
if changes:
|
if staged_changes:
|
||||||
click.echo(click.style(f"❌ There are staged or unstaged changes. Please commit or unstage 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:
|
||||||
@@ -500,12 +501,13 @@ 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'))
|
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
|
return
|
||||||
|
|
||||||
# Check if there are staged or unstaged changes
|
# Check if there are staged changes
|
||||||
changes = subprocess.check_output(['git', 'status', '--porcelain']).decode('utf-8').strip()
|
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')]
|
||||||
if changes:
|
if staged_changes:
|
||||||
click.echo(click.style(f"❌ There are staged or unstaged changes. Please commit or unstage 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
|
||||||
|
|||||||
Reference in New Issue
Block a user